tried making gem; removed node_modules
This commit is contained in:
Родитель
fce572823f
Коммит
016c5ec56b
|
@ -1 +1,5 @@
|
|||
/_site
|
||||
*.gem
|
||||
.bundle
|
||||
.sass-cache
|
||||
_site
|
||||
Gemfile.lock
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -1,4 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
source 'https://rubygems.org'
|
||||
gemspec
|
||||
gem 'github-pages', group: :jekyll_plugins, github: "github/pages-gem", branch: "master"
|
||||
gem "jekyll-github-metadata", github: "kenyonj/github-metadata", branch: "jk-add-repo-stars-forks-hireable"
|
||||
|
||||
|
|
10
Gemfile.lock
10
Gemfile.lock
|
@ -58,6 +58,12 @@ GIT
|
|||
jekyll (~> 3.4)
|
||||
octokit (~> 4.0, != 4.4.0)
|
||||
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
github-personal-website (0.1.1)
|
||||
jekyll (~> 3.7)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
|
@ -229,6 +235,7 @@ GEM
|
|||
pathutil (0.16.2)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (2.0.5)
|
||||
rake (12.3.1)
|
||||
rb-fsevent (0.10.3)
|
||||
rb-inotify (0.10.0)
|
||||
ffi (~> 1.0)
|
||||
|
@ -259,9 +266,12 @@ PLATFORMS
|
|||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
bundler (~> 2.0.1)
|
||||
github-pages!
|
||||
github-personal-website!
|
||||
jekyll-github-metadata!
|
||||
jekyll-octicons
|
||||
rake (~> 12.0)
|
||||
|
||||
BUNDLED WITH
|
||||
2.0.1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
Copyright (c) 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
52
README.md
52
README.md
|
@ -1 +1,51 @@
|
|||
# profile-generator
|
||||
# github-personal-website
|
||||
|
||||
Welcome to your new Jekyll theme! In this directory, you'll find the files you need to be able to package up your theme into a gem. Put your layouts in `_layouts`, your includes in `_includes`, your sass files in `_sass` and any other assets in `assets`.
|
||||
|
||||
To experiment with this code, add some sample content and run `bundle exec jekyll serve` – this directory is setup just like a Jekyll site!
|
||||
|
||||
TODO: Delete this and the text above, and describe your gem
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Add this line to your Jekyll site's `Gemfile`:
|
||||
|
||||
```ruby
|
||||
gem "github-personal-website"
|
||||
```
|
||||
|
||||
And add this line to your Jekyll site's `_config.yml`:
|
||||
|
||||
```yaml
|
||||
theme: github-personal-website
|
||||
```
|
||||
|
||||
And then execute:
|
||||
|
||||
$ bundle
|
||||
|
||||
Or install it yourself as:
|
||||
|
||||
$ gem install github-personal-website
|
||||
|
||||
## Usage
|
||||
|
||||
TODO: Write usage instructions here. Describe your available layouts, includes, sass and/or assets.
|
||||
|
||||
## Contributing
|
||||
|
||||
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hello. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
||||
|
||||
## Development
|
||||
|
||||
To set up your environment to develop this theme, run `bundle install`.
|
||||
|
||||
Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
|
||||
|
||||
When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
|
||||
To add a custom directory to your theme-gem, please edit the regexp in `github-personal-website.gemspec` accordingly.
|
||||
|
||||
## License
|
||||
|
||||
The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
||||
|
|
12
_config.yml
12
_config.yml
|
@ -1,11 +1,8 @@
|
|||
repository: sophshep/manager-resources
|
||||
|
||||
layout: sidebar
|
||||
style: light
|
||||
|
||||
sass:
|
||||
load_paths:
|
||||
- node_modules
|
||||
|
||||
plugins:
|
||||
- jekyll-octicons
|
||||
- jekyll-github-metadata
|
||||
|
@ -18,16 +15,15 @@ defaults:
|
|||
path: "" # an empty string here means all files in the project
|
||||
type: "posts"
|
||||
values:
|
||||
layout: "sidebar"
|
||||
is_post: true
|
||||
layout: "post"
|
||||
|
||||
topics:
|
||||
- name: Web design
|
||||
|
||||
- name: CSS
|
||||
github_name: css
|
||||
image_url: https://raw.githubusercontent.com/github/explore/6c6508f34230f0ac0d49e847a326429eefbfc030/topics/css/css.png
|
||||
|
||||
- name: Web design
|
||||
|
||||
- name: Sass
|
||||
github_name: sass
|
||||
image_url: https://raw.githubusercontent.com/github/explore/6c6508f34230f0ac0d49e847a326429eefbfc030/topics/sass/sass.png
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ site.github.owner.name }}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link href="/assets/styles.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body class="bg-gray-light" {% if site.style == 'dark' %}style="background-color: #2f363d !important"{% endif %}>
|
||||
<body class="bg-white" {% if site.style == 'dark' %}style="background-color: #2f363d !important"{% endif %}>
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
{% if site.layout == 'stacked' %}
|
||||
{% assign metadata_styles = 'd-md-inline-block mr-3' %}
|
||||
{% else %}
|
||||
{% assign metadata_styles = 'd-flex flex-items-center mb-3' %}
|
||||
{% endif %}
|
||||
|
||||
<img src="{{ user.avatar_url }}" class="circle mb-3" style="max-width: 150px;">
|
||||
<h1 class="{% if site.style == 'dark' %}text-white{% endif %} mb-2 lh-condensed">{% if user.name %}{{ user.name }}{% else %}{{ user.login }}{% endif %}</h1>
|
||||
<p class="mb-3 f4 {% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %}">
|
||||
{{ user.bio }}
|
||||
</p>
|
||||
|
||||
{% if include.metadata %}
|
||||
<div class="f4 mb-6">
|
||||
{% if user.name %}
|
||||
<div class="{{ metadata_styles }}">
|
||||
{% octicon mark-github height:20 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:GitHub %}
|
||||
<a href="https://github.com/{{ user.login }}" {% if site.style == 'dark' %}class="text-white"{% endif %}>
|
||||
@{{ user.login }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.email %}
|
||||
<div class="{{ metadata_styles }}">
|
||||
{% octicon mail height:20 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:email %}
|
||||
<a href="mailto:{{ user.email }}" {% if site.style == 'dark' %}class="text-white"{% endif %}>
|
||||
{{ user.email }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.location %}
|
||||
<div class="{{ metadata_styles }} {% if site.style == 'dark' %}text-white{% endif %}">
|
||||
{% octicon location height:20 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:Location %}
|
||||
{{ user.location }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.hireable %}
|
||||
<span title="Hire me" class="d-inline-block f5 rounded-2 text-white bg-green py-1 px-2">Available for hire</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
|
@ -0,0 +1,33 @@
|
|||
{% include header.html %}
|
||||
|
||||
{% if site.layout == 'stacked' %}
|
||||
<div class="container-lg py-6 p-responsive text-center">
|
||||
{% include masthead.html metadata=false %}
|
||||
|
||||
<div class="container-md f4 text-left border rounded-2 bg-white p-3 p-sm-5 mt-6">
|
||||
<p class="f5"><a href="/" class="d-flex flex-items-center">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:#0366d6 aria-label:Home %}Home</a></p>
|
||||
<h1 class="f00-light lh-condensed mb-5">{{ page.title }}</h1>
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="d-md-flex {% unless site.style == 'dark' %}border-md-bottom{% endunless %}">
|
||||
<div class="flex-self-stretch {% if site.style == 'dark' %}bg-gray-dark{% else %}border-md-right border-gray-light bg-white{% endif %} col-md-5 col-lg-4 col-xl-3 px-4 px-md-6 px-lg-7 py-6">
|
||||
{% include masthead.html metadata=true %}
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7 border-top border-md-top-0 bg-gray-light" {% if site.style == 'dark' %}style="background-color: #2f363d !important"{% endif %}>
|
||||
<div class="mx-auto" style="max-width: 900px;">
|
||||
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %} mb-6">
|
||||
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %}">
|
||||
<p class="f5"><a href="/" class="d-flex flex-items-center {% if site.style == 'dark' %}text-white{% endif %}">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:Home %}Home</a></p>
|
||||
<h1 class="f00-light lh-condensed mb-5">{{ page.title }}</h1>
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% include footer.html %}
|
|
@ -0,0 +1,55 @@
|
|||
{% include header.html %}
|
||||
|
||||
{% if site.layout == 'stacked' %}
|
||||
<div class="container-lg py-6 p-responsive text-center">
|
||||
{% include masthead.html metadata=true %}
|
||||
|
||||
<div {% if site.style == 'dark' %}class="text-white"{% endif %}>
|
||||
{{ content }}
|
||||
</div>
|
||||
|
||||
<div class="my-6">
|
||||
{% include projects.html %}
|
||||
</div>
|
||||
|
||||
{% if site.topics %}
|
||||
<div class="my-6">
|
||||
{% include interests.html %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% unless posts_total == 0 %}
|
||||
<div class="my-6">
|
||||
{% include thoughts.html %}
|
||||
</div>
|
||||
{% endunless %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="d-md-flex {% unless site.style == 'dark' %}border-md-bottom{% endunless %}">
|
||||
<div class="flex-self-stretch {% if site.style == 'dark' %}bg-gray-dark{% else %}border-md-right border-gray-light bg-white{% endif %} col-md-5 col-lg-4 col-xl-3 px-4 px-md-6 px-lg-7 py-6">
|
||||
{% include masthead.html metadata=true %}
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7 border-top border-md-top-0 bg-gray-light" {% if site.style == 'dark' %}style="background-color: #2f363d !important"{% endif %}>
|
||||
<div class="mx-auto" style="max-width: 900px;">
|
||||
{% unless content == "" %}
|
||||
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %} mb-6">
|
||||
{{ content }}
|
||||
</div>
|
||||
{% endunless %}
|
||||
|
||||
{% include projects.html %}
|
||||
|
||||
{% if site.topics %}
|
||||
{% include interests.html %}
|
||||
{% endif %}
|
||||
|
||||
{% unless posts_total == 0 %}
|
||||
{% include thoughts.html %}
|
||||
{% endunless %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% include footer.html %}
|
|
@ -0,0 +1,35 @@
|
|||
{% include header.html %}
|
||||
|
||||
{% if site.layout == 'stacked' %}
|
||||
<div class="container-lg py-6 p-responsive text-center">
|
||||
{% include masthead.html metadata=false %}
|
||||
|
||||
<div class="container-md f4 text-left border rounded-2 bg-white p-3 p-sm-5 mt-6">
|
||||
<p class="f5"><a href="/" class="d-flex flex-items-center">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:#0366d6 aria-label:Home %}Home</a></p>
|
||||
<h1 class="f00-light lh-condensed">{{ page.title }}</h1>
|
||||
<p class="{% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %} mb-5">Published {{ page.date | date: "%b %d, %Y"}}</p>
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="d-md-flex {% unless site.style == 'dark' %}border-md-bottom{% endunless %}">
|
||||
<div class="flex-self-stretch {% if site.style == 'dark' %}bg-gray-dark{% else %}border-md-right border-gray-light bg-white{% endif %} col-md-5 col-lg-4 col-xl-3 px-4 px-md-6 px-lg-7 py-6">
|
||||
{% include masthead.html metadata=true %}
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7 border-top border-md-top-0 bg-gray-light" {% if site.style == 'dark' %}style="background-color: #2f363d !important"{% endif %}>
|
||||
<div class="mx-auto" style="max-width: 900px;">
|
||||
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %} mb-6">
|
||||
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %}">
|
||||
<p class="f5"><a href="/" class="d-flex flex-items-center {% if site.style == 'dark' %}text-white{% endif %}">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:Home %}Home</a></p>
|
||||
<h1 class="f00-light lh-condensed">{{ page.title }}</h1>
|
||||
<p class="{% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %} mb-5">Published {{ page.date | date: "%b %d, %Y"}}</p>
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% include footer.html %}
|
|
@ -1,72 +0,0 @@
|
|||
{% include header.html %}
|
||||
|
||||
<div class="d-md-flex" style="height: 100vh">
|
||||
<div class="flex-self-stretch {% if site.style == 'dark' %}bg-gray-dark{% else %}border-bottom border-md-none border-md-right border-gray-light bg-white{% endif %} col-md-5 col-lg-4 col-xl-3 px-4 px-md-6 px-lg-7 py-6">
|
||||
<img src="{{ user.avatar_url }}" class="circle mb-3" style="max-width: 150px;">
|
||||
<h1 class="{% if site.style == 'dark' %}text-white{% endif %} mb-2 lh-condensed">{% if user.name %}{{ user.name }}{% else %}{{ user.login }}{% endif %}</h1>
|
||||
<p class="mb-3 f4 {% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %}">
|
||||
{{ user.bio }}
|
||||
</p>
|
||||
<div class="f4 mb-6">
|
||||
{% if user.name %}
|
||||
<div class="d-flex flex-items-center mb-3">
|
||||
{% octicon mark-github height:20 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:GitHub %}
|
||||
<a href="https://github.com/{{ user.login }}" {% if site.style == 'dark' %}class="text-white"{% endif %}>
|
||||
@{{ user.login }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.email %}
|
||||
<div class="d-flex flex-items-center mb-3">
|
||||
{% octicon mail height:20 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:email %}
|
||||
<a href="mailto:{{ user.email }}" {% if site.style == 'dark' %}class="text-white"{% endif %}>
|
||||
{{ user.email }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.location %}
|
||||
<div class="d-flex flex-items-center {% if site.style == 'dark' %}text-white{% endif %} mb-3">
|
||||
{% octicon location height:20 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:Location %}
|
||||
{{ user.location }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.hireable %}
|
||||
<span title="Hire me" class="d-inline-block f5 rounded-2 text-white bg-green py-1 px-2">Available for hire</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7">
|
||||
<div class="mx-auto" style="max-width: 900px;">
|
||||
|
||||
{% unless content == "" %}
|
||||
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %} mb-6">
|
||||
{% if page.is_post %}
|
||||
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %}">
|
||||
<p class="f5"><a href="/" class="d-flex flex-items-center {% if site.style == 'dark' %}text-white{% endif %}">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:Home %}Home</a></p>
|
||||
<h1 class="f00-light lh-condensed">{{ page.title }}</h1>
|
||||
<p class="mb-5">Published {{ page.date | date: "%b %d, %Y"}}</p>
|
||||
{{ content }}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ content }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endunless %}
|
||||
|
||||
{% unless page.is_post %}
|
||||
{% include projects.html %}
|
||||
|
||||
{% if site.topics %}
|
||||
{% include interests.html %}
|
||||
{% endif %}
|
||||
|
||||
{% unless posts_total == 0 %}
|
||||
{% include thoughts.html %}
|
||||
{% endunless %}
|
||||
{% endunless %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include footer.html %}
|
|
@ -1,70 +0,0 @@
|
|||
{% include header.html %}
|
||||
|
||||
<div class="container-lg py-6 p-responsive text-center">
|
||||
<img src="{{ user.avatar_url }}" class="circle mb-3" style="max-width: 150px;">
|
||||
<h1 class="{% if site.style == 'dark' %}text-white{% endif %} mb-2 lh-condensed">{% if user.name %}{{ user.name }}{% else %}{{ user.login }}{% endif %}</h1>
|
||||
<p class="col-lg-8 mx-auto mb-3 f3 {% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %}">
|
||||
{{ user.bio }}
|
||||
</p>
|
||||
{% unless page.is_post %}
|
||||
<div class="f4 mb-6">
|
||||
{% if user.name %}
|
||||
<div class="d-md-inline-block mr-3">
|
||||
{% octicon mark-github height:20 class:"mr-1 v-align-middle" fill:{{ icon_color }} aria-label:GitHub %}
|
||||
<a href="https://github.com/{{ user.login }}" {% if site.style == 'dark' %}class="text-white"{% endif %}>
|
||||
@{{ user.login }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.email %}
|
||||
<div class="d-md-inline-block mr-3">
|
||||
{% octicon mail height:20 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:email %}
|
||||
<a href="mailto:{{ user.email }}" {% if site.style == 'dark' %}class="text-white"{% endif %}>
|
||||
{{ user.email }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.location %}
|
||||
<div class="d-md-inline-block {% if site.style == 'dark' %}text-white{% endif %}">
|
||||
{% octicon location height:20 class:"mr-1 v-align-middle" fill:{{ icon_color }} aria-label:Location %}
|
||||
{{ user.location }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endunless %}
|
||||
|
||||
{% if page.is_post %}
|
||||
<div class="container-md f4 text-left border rounded-2 bg-white p-3 p-sm-5 mt-6">
|
||||
<p class="f5"><a href="/" class="d-flex flex-items-center">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:#0366d6 aria-label:Home %}Home</a></p>
|
||||
<h1 class="f00-light lh-condensed">{{ page.title }}</h1>
|
||||
<p class="mb-5">Published {{ page.date | date: "%b %d, %Y"}}</p>
|
||||
{{ content }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div {% if site.style == 'dark' %}class="text-white"{% endif %}>
|
||||
{{ content }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% unless page.is_post %}
|
||||
<div class="my-6">
|
||||
{% include projects.html %}
|
||||
</div>
|
||||
|
||||
{% if site.topics %}
|
||||
<div class="my-6">
|
||||
{% include interests.html %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% unless posts_total == 0 %}
|
||||
<div class="my-6">
|
||||
{% include thoughts.html %}
|
||||
</div>
|
||||
{% endunless %}
|
||||
{% endunless %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{% include footer.html %}
|
|
@ -1 +1,51 @@
|
|||
# profile-generator
|
||||
# github-personal-website
|
||||
|
||||
Welcome to your new Jekyll theme! In this directory, you'll find the files you need to be able to package up your theme into a gem. Put your layouts in `_layouts`, your includes in `_includes`, your sass files in `_sass` and any other assets in `assets`.
|
||||
|
||||
To experiment with this code, add some sample content and run `bundle exec jekyll serve` – this directory is setup just like a Jekyll site!
|
||||
|
||||
TODO: Delete this and the text above, and describe your gem
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Add this line to your Jekyll site's `Gemfile`:
|
||||
|
||||
```ruby
|
||||
gem "github-personal-website"
|
||||
```
|
||||
|
||||
And add this line to your Jekyll site's `_config.yml`:
|
||||
|
||||
```yaml
|
||||
theme: github-personal-website
|
||||
```
|
||||
|
||||
And then execute:
|
||||
|
||||
$ bundle
|
||||
|
||||
Or install it yourself as:
|
||||
|
||||
$ gem install github-personal-website
|
||||
|
||||
## Usage
|
||||
|
||||
TODO: Write usage instructions here. Describe your available layouts, includes, sass and/or assets.
|
||||
|
||||
## Contributing
|
||||
|
||||
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hello. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
||||
|
||||
## Development
|
||||
|
||||
To set up your environment to develop this theme, run `bundle install`.
|
||||
|
||||
Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
|
||||
|
||||
When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
|
||||
To add a custom directory to your theme-gem, please edit the regexp in `github-personal-website.gemspec` accordingly.
|
||||
|
||||
## License
|
||||
|
||||
The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -11,44 +11,50 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Sophie Shepherd</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link href="/assets/styles.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body class="bg-gray-light" >
|
||||
<body class="bg-white" >
|
||||
|
||||
|
||||
<div class="d-md-flex" style="height: 100vh">
|
||||
<div class="flex-self-stretch border-bottom border-md-none border-md-right border-gray-light bg-white col-md-5 col-lg-4 col-xl-3 px-4 px-md-6 px-lg-7 py-6">
|
||||
<img src="https://avatars3.githubusercontent.com/u/527589?v=4" class="circle mb-3" style="max-width: 150px;">
|
||||
<h1 class=" mb-2 lh-condensed">Sophie Shepherd</h1>
|
||||
<p class="mb-3 f4 text-gray">
|
||||
✏ Design manager at @github
|
||||
</p>
|
||||
<div class="f4 mb-6">
|
||||
|
||||
<div class="d-md-flex border-md-bottom">
|
||||
<div class="flex-self-stretch border-md-right border-gray-light bg-white col-md-5 col-lg-4 col-xl-3 px-4 px-md-6 px-lg-7 py-6">
|
||||
|
||||
<div class="d-flex flex-items-center mb-3">
|
||||
<svg height="20" class="octicon octicon-mark-github mr-2 v-align-middle" fill="#24292e" aria-label="GitHub" viewBox="0 0 16 16" version="1.1" width="20" role="img"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
|
||||
<a href="https://github.com/sophshep" >
|
||||
@sophshep
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="d-flex flex-items-center mb-3">
|
||||
<svg height="20" class="octicon octicon-location mr-2 v-align-middle" fill="#24292e" aria-label="Location" viewBox="0 0 12 16" version="1.1" width="15" role="img"><path fill-rule="evenodd" d="M6 0C2.69 0 0 2.5 0 5.5 0 10.02 6 16 6 16s6-5.98 6-10.5C12 2.5 9.31 0 6 0zm0 14.55C4.14 12.52 1 8.44 1 5.5 1 3.02 3.25 1 6 1c1.34 0 2.61.48 3.56 1.36.92.86 1.44 1.97 1.44 3.14 0 2.94-3.14 7.02-5 9.05zM8 5.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg>
|
||||
Austin TX
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<img src="https://avatars3.githubusercontent.com/u/527589?v=4" class="circle mb-3" style="max-width: 150px;">
|
||||
<h1 class=" mb-2 lh-condensed">Sophie Shepherd</h1>
|
||||
<p class="mb-3 f4 text-gray">
|
||||
✏ Design manager at @github
|
||||
</p>
|
||||
|
||||
|
||||
<div class="f4 mb-6">
|
||||
|
||||
<div class="d-flex flex-items-center mb-3">
|
||||
<svg height="20" class="octicon octicon-mark-github mr-2 v-align-middle" fill="#24292e" aria-label="GitHub" viewBox="0 0 16 16" version="1.1" width="20" role="img"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
|
||||
<a href="https://github.com/sophshep" >
|
||||
@sophshep
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="d-flex flex-items-center mb-3 ">
|
||||
<svg height="20" class="octicon octicon-location mr-2 v-align-middle" fill="#24292e" aria-label="Location" viewBox="0 0 12 16" version="1.1" width="15" role="img"><path fill-rule="evenodd" d="M6 0C2.69 0 0 2.5 0 5.5 0 10.02 6 16 6 16s6-5.98 6-10.5C12 2.5 9.31 0 6 0zm0 14.55C4.14 12.52 1 8.44 1 5.5 1 3.02 3.25 1 6 1c1.34 0 2.61.48 3.56 1.36.92.86 1.44 1.97 1.44 3.14 0 2.94-3.14 7.02-5 9.05zM8 5.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg>
|
||||
Austin TX
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7">
|
||||
<div class="mx-auto" style="max-width: 900px;">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7 border-top border-md-top-0 bg-gray-light" >
|
||||
<div class="mx-auto" style="max-width: 900px;">
|
||||
|
||||
|
||||
|
||||
<h2 >My Projects</h2>
|
||||
<p class="f4 mb-4 text-gray">GitHub repositories that I've built.</p>
|
||||
<div class="d-sm-flex flex-wrap gutter-condensed mb-4">
|
||||
|
@ -175,6 +181,19 @@
|
|||
|
||||
<div class="col-6 col-md-12 col-lg-6 col-xl-4 mb-3">
|
||||
|
||||
<a href="https://github.com/topics/css" class="github-component position-relative hover-grow height-full no-underline d-flex flex-column flex-justify-center text-center border border-gray-light rounded-1 bg-white p-5">
|
||||
|
||||
<img src="https://raw.githubusercontent.com/github/explore/6c6508f34230f0ac0d49e847a326429eefbfc030/topics/css/css.png" width="64" height="64" class="mx-auto rounded-1 mb-3" alt="CSS">
|
||||
|
||||
<p class="f3 lh-condensed text-center link-gray-dark mb-0 mt-1">CSS</p>
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-md-12 col-lg-6 col-xl-4 mb-3">
|
||||
|
||||
<div class="github-component position-relative height-full text-center border border-gray-light rounded-1 bg-white p-5">
|
||||
|
||||
<div
|
||||
|
@ -189,19 +208,6 @@
|
|||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-md-12 col-lg-6 col-xl-4 mb-3">
|
||||
|
||||
<a href="https://github.com/topics/css" class="github-component position-relative hover-grow height-full no-underline d-flex flex-column flex-justify-center text-center border border-gray-light rounded-1 bg-white p-5">
|
||||
|
||||
<img src="https://raw.githubusercontent.com/github/explore/6c6508f34230f0ac0d49e847a326429eefbfc030/topics/css/css.png" width="64" height="64" class="mx-auto rounded-1 mb-3" alt="CSS">
|
||||
|
||||
<p class="f3 lh-condensed text-center link-gray-dark mb-0 mt-1">CSS</p>
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-md-12 col-lg-6 col-xl-4 mb-3">
|
||||
|
@ -222,10 +228,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,289 +0,0 @@
|
|||
{
|
||||
"name": "profile-generator",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"add-subtract-date": {
|
||||
"version": "1.0.14",
|
||||
"resolved": "https://registry.npmjs.org/add-subtract-date/-/add-subtract-date-1.0.14.tgz",
|
||||
"integrity": "sha512-e070xJdKBEEdAgCJJm1nBSdGv4Y6C2LXP9PYHBUJPV/3eUkZ46bnnkzejmXmTFYyIsiouLPt26yGgsHZL7WDvg=="
|
||||
},
|
||||
"days": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/days/-/days-1.1.1.tgz",
|
||||
"integrity": "sha512-vzeIwVsEIyA35GH4+mPd4hjVDNI87wYANyZFs0BHjBr5kIBH5zEl7LfD6Wr4SFZca4D3CU9IH1w4DuZLlXzKRw=="
|
||||
},
|
||||
"elly": {
|
||||
"version": "1.1.10",
|
||||
"resolved": "https://registry.npmjs.org/elly/-/elly-1.1.10.tgz",
|
||||
"integrity": "sha512-CXlhCGIzVjX1SLPttmq2fo7wsOlfPMsxqf8rIbpFSkNWC+U8Nuldo6rG6oeFiBY9+8e7YcizwDnyK72APWH+dQ==",
|
||||
"requires": {
|
||||
"iterate-object": "^1.3.2",
|
||||
"sliced": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"fillo": {
|
||||
"version": "1.0.12",
|
||||
"resolved": "https://registry.npmjs.org/fillo/-/fillo-1.0.12.tgz",
|
||||
"integrity": "sha512-WjV09RN7NEp1EazSNKJVZCVHeWYj4MNyb4HX1BAyrW4j0OW2UPJukP4SUkJt9Nj7gWgyD6avK0mH5bjwOZFViw=="
|
||||
},
|
||||
"formatoid": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/formatoid/-/formatoid-1.2.3.tgz",
|
||||
"integrity": "sha512-CkI0aK01nKhHoFZByDKw/yrNPy+g56DNIEmlq0Q67grdR/LLV8Orc9gsTGVP7XufM3bZg8iuD5UsVfkOdJo2yg==",
|
||||
"requires": {
|
||||
"days": "^1.0.1",
|
||||
"fillo": "^1.0.0",
|
||||
"months": "^1.0.0",
|
||||
"parse-it": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"github-calendar": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/github-calendar/-/github-calendar-1.3.1.tgz",
|
||||
"integrity": "sha512-ABlceh7wTRLvKQK1h0srrD9FHjHeHXtsxPw8sEUOX9uq4YItlrPaLY7ftNuvC0N1w6yCjcQBV+zjIzNAD9iczg==",
|
||||
"requires": {
|
||||
"add-subtract-date": "^1.0.5",
|
||||
"elly": "^1.0.0",
|
||||
"formatoid": "^1.0.3",
|
||||
"github-calendar-parser": "^1.1.3"
|
||||
}
|
||||
},
|
||||
"github-calendar-legend": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/github-calendar-legend/-/github-calendar-legend-1.0.10.tgz",
|
||||
"integrity": "sha512-dDfX2Hvl98mSNbM9jRsZoZ0STb/AJcaf8ofRGXpH2oHtiQ73IlL8LFzOUzp49xSTFf0XYBs4DCXEhgbh+Fir2A=="
|
||||
},
|
||||
"github-calendar-parser": {
|
||||
"version": "1.1.10",
|
||||
"resolved": "https://registry.npmjs.org/github-calendar-parser/-/github-calendar-parser-1.1.10.tgz",
|
||||
"integrity": "sha512-muDJpHio2ATZ9WXqTjyrFitLxFlJyZTy/c0EtiNhOwPzUBW4zr3mnX1qoiZM8DkgbLAyZY5CoEno3GEXPDSMPQ==",
|
||||
"requires": {
|
||||
"github-calendar-legend": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"iterate-object": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/iterate-object/-/iterate-object-1.3.3.tgz",
|
||||
"integrity": "sha512-DximWbkke36cnrSfNJv6bgcB2QOMV9PRD2FiowwzCoMsh8RupFLdbNIzWe+cVDWT+NIMNJgGlB1dGxP6kpzGtA=="
|
||||
},
|
||||
"months": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/months/-/months-1.2.0.tgz",
|
||||
"integrity": "sha512-zFM7hUpziSYGk2DNObYGWgHdRRxAOgjl8CC1Rbl50p/q0rGDsREfk0nbxxmSIquVi/lEAuUY8nwbwkZ8biNCOQ=="
|
||||
},
|
||||
"parse-it": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/parse-it/-/parse-it-1.0.9.tgz",
|
||||
"integrity": "sha512-8KW9XwW5+DFsvkkSXLZw7AGormnQ+/unnqmTPq7uoiAJNaeLo0T78zT/Ootc0HrdEgVvxM4+mOCRLKJOVtkogQ==",
|
||||
"requires": {
|
||||
"regex-escape": "^3.4.0"
|
||||
}
|
||||
},
|
||||
"primer-base": {
|
||||
"version": "1.9.2",
|
||||
"resolved": "https://registry.npmjs.org/primer-base/-/primer-base-1.9.2.tgz",
|
||||
"integrity": "sha512-KgZP0cGq0rdgyK5ozw7UbyqG52o0sbzAfRP3iEeoRhDwCJ3X0XaHeCINty7QhcIzWCccXkdamMe/P6HBwWM12g==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-box": {
|
||||
"version": "2.5.13",
|
||||
"resolved": "https://registry.npmjs.org/primer-box/-/primer-box-2.5.13.tgz",
|
||||
"integrity": "sha512-ZNZ8TFU05gqZx1oSk6DVdjACOOPsdJZqn0qYBcfsEu+AQQiKJ7HVH8pgODlH5tqj8Ihtoz3Q1CxCmrZhVnjnbA==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-breadcrumb": {
|
||||
"version": "1.5.9",
|
||||
"resolved": "https://registry.npmjs.org/primer-breadcrumb/-/primer-breadcrumb-1.5.9.tgz",
|
||||
"integrity": "sha512-A2+rm3Gi2vk4LYr8yWrNwYNc2i59gcnfAGyT/QJ7G66R0kLD8M3rIPDw2vmRY5LagTvZ8KnY6wRwc5GSSKVBDQ==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-buttons": {
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-buttons/-/primer-buttons-2.6.4.tgz",
|
||||
"integrity": "sha512-6+wFjXKGk76qZmUrnUTXm8Zo6viiNlcGcSSiW89OeAW2qkHHlTvyMqoKwExg8nGNFbLIGxhvqb9V++nx20Pq1Q==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-core": {
|
||||
"version": "6.10.9",
|
||||
"resolved": "https://registry.npmjs.org/primer-core/-/primer-core-6.10.9.tgz",
|
||||
"integrity": "sha512-OJmJzhjw4UXXU/IzH3JoJL6KGHfWep8G8t+EHNGIJVHBsrGQYylp5iEcsPuHLDQVpKbOtuj3Rqg3ef53ei2R5A==",
|
||||
"requires": {
|
||||
"primer-base": "1.9.2",
|
||||
"primer-box": "2.5.13",
|
||||
"primer-breadcrumb": "1.5.9",
|
||||
"primer-buttons": "2.6.4",
|
||||
"primer-forms": "2.1.8",
|
||||
"primer-layout": "1.6.2",
|
||||
"primer-navigation": "1.5.11",
|
||||
"primer-pagination": "1.0.7",
|
||||
"primer-support": "4.7.2",
|
||||
"primer-table-object": "1.4.13",
|
||||
"primer-tooltips": "1.5.11",
|
||||
"primer-truncate": "1.4.13",
|
||||
"primer-utilities": "4.14.4"
|
||||
}
|
||||
},
|
||||
"primer-forms": {
|
||||
"version": "2.1.8",
|
||||
"resolved": "https://registry.npmjs.org/primer-forms/-/primer-forms-2.1.8.tgz",
|
||||
"integrity": "sha512-bAobB7DUWphIjdcXfPD6CPWwvWBp5hbH65seO0OT+KkYbCLrDZCeFxLfRs9u1LyYN07DJR/vf4k8wom0Bksr4A==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-layout": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmjs.org/primer-layout/-/primer-layout-1.6.2.tgz",
|
||||
"integrity": "sha512-Ov/g9GiAaKhRAXku2wxsTlmJXhQPAjWpCwibJ+Ooxu0X8n6BA52y/ScZUPFdde+vZYhbFGFQwozU8y2bzuw3dg==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-marketing": {
|
||||
"version": "6.3.3",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing/-/primer-marketing-6.3.3.tgz",
|
||||
"integrity": "sha512-vmR/YkOlFnQVQSxluXe5lbkH+B7Z2tirgCDGVp+SD9Zs+FJ6YRELmw6cjm0okVkH9205qcMvy9INOunkhKrktw==",
|
||||
"requires": {
|
||||
"primer-marketing-buttons": "1.0.13",
|
||||
"primer-marketing-support": "1.5.6",
|
||||
"primer-marketing-type": "1.4.13",
|
||||
"primer-marketing-utilities": "1.7.3",
|
||||
"primer-page-headers": "1.5.3",
|
||||
"primer-page-sections": "1.5.3",
|
||||
"primer-support": "4.7.2",
|
||||
"primer-tables": "1.5.3"
|
||||
}
|
||||
},
|
||||
"primer-marketing-buttons": {
|
||||
"version": "1.0.13",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing-buttons/-/primer-marketing-buttons-1.0.13.tgz",
|
||||
"integrity": "sha512-1MzzrG/68zaEcQypG50uELwQ4MHH9b8aTy3jXxayZRc1qvZaLh5SEcSIHWe5lMIZk8qrtYhr22py9+kibyTKIQ==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-marketing-support": {
|
||||
"version": "1.5.6",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing-support/-/primer-marketing-support-1.5.6.tgz",
|
||||
"integrity": "sha512-YU8ein52s/W+s4a4hHZZJbHURfz2FLI5ItrUxqaqJjcT0O2bALP/JbuCZDrbvWxuOSK4kbF22ANmmMGWFIzp/Q=="
|
||||
},
|
||||
"primer-marketing-type": {
|
||||
"version": "1.4.13",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing-type/-/primer-marketing-type-1.4.13.tgz",
|
||||
"integrity": "sha512-ke6l3zgc4mF5ArDzZB1TJ5VHbZG2/uwekVROLQOK4v7XI0MkYZWA9tI+k8UhaFLSsw0vGqxM2ibKUzsQH61C8g==",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.5.6",
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-marketing-utilities": {
|
||||
"version": "1.7.3",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing-utilities/-/primer-marketing-utilities-1.7.3.tgz",
|
||||
"integrity": "sha512-YYDPgyC0G65tPHwZ6ktxfEAqUkJlU2sZjzdcH7thlcg83/UqiZfgmgiiBAxdMjrACY7Q2X9HaHicr5F4rmPhPw==",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.5.6",
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-navigation": {
|
||||
"version": "1.5.11",
|
||||
"resolved": "https://registry.npmjs.org/primer-navigation/-/primer-navigation-1.5.11.tgz",
|
||||
"integrity": "sha512-Fykn/zuJX8z8kEIkzxnbwZhbCbYbuQF7Iv+03yzBeesOfN4VaQKgpTtaAXW26NB1BjOo3omrhVivYoejTFXbuw==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-page-headers": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/primer-page-headers/-/primer-page-headers-1.5.3.tgz",
|
||||
"integrity": "sha512-SVgAnr1jz/8qNhr+LsQayHGGICi1pCfBJV2R+zhcooDJC29ddSoTW+LpwvBj1P68c7sJfaMPRmlcq0hUGGG/Pw==",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.5.6",
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-page-sections": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/primer-page-sections/-/primer-page-sections-1.5.3.tgz",
|
||||
"integrity": "sha512-xaj6v+v3FvaSMVFDZAYsrObkvOviPwxYZt0rrkMeoyhrMVG2uB3nD3Kmu3st9UbwobdXjMTSKPkKBcarckwhuw==",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.5.6",
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-pagination": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/primer-pagination/-/primer-pagination-1.0.7.tgz",
|
||||
"integrity": "sha512-c0Vmc3ZYspn+JdY6nmH626c+bxkuJLToYueksEMOrET4da05xwnC8dF7v6fh7UlBZ+qNArf+SsFWqXJPW5C8IA==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-support": {
|
||||
"version": "4.7.2",
|
||||
"resolved": "https://registry.npmjs.org/primer-support/-/primer-support-4.7.2.tgz",
|
||||
"integrity": "sha512-WbfjjITtGV6iXQeaVPL+AzHj1Jv9RHJRp7kIu5ebFXwolWmCqTBpA/8VmWmssyeTfv8zR7iuCoT0UoBF+uGHww=="
|
||||
},
|
||||
"primer-table-object": {
|
||||
"version": "1.4.13",
|
||||
"resolved": "https://registry.npmjs.org/primer-table-object/-/primer-table-object-1.4.13.tgz",
|
||||
"integrity": "sha512-JoU/T1aubSg3cvEXh5K95X63W5bJLFlvDflVWMc8QJKiHBPmICH7yccsGI+ybhEUnd7MUD+BEXKgQwM+Iinv5g==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-tables": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/primer-tables/-/primer-tables-1.5.3.tgz",
|
||||
"integrity": "sha512-ZTBG2qQvE9qKI8N7sdN39F8y5sckDRSFR4JkTVQqujrXwoK7kGeqdNXirKFSuzSyW9MnBt02tOTQ65xC0xl3sg==",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.5.6",
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-tooltips": {
|
||||
"version": "1.5.11",
|
||||
"resolved": "https://registry.npmjs.org/primer-tooltips/-/primer-tooltips-1.5.11.tgz",
|
||||
"integrity": "sha512-r0C4gnzg8hChoKVU5hC+e7BlKM3gkO+W8L1o91RCDiguN9S0u/yo3DQwlVL68igvAP34NEYzchsZ82BkQkd1Dg==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-truncate": {
|
||||
"version": "1.4.13",
|
||||
"resolved": "https://registry.npmjs.org/primer-truncate/-/primer-truncate-1.4.13.tgz",
|
||||
"integrity": "sha512-/3saQDL8n77nGJ7zMT05PKTKeMTFrR2QVjZsD5XnOblMiglND95ozOKef0sDcyrgR7fv+qLMXr56+QS/FWFSsw==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"primer-utilities": {
|
||||
"version": "4.14.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-utilities/-/primer-utilities-4.14.4.tgz",
|
||||
"integrity": "sha512-EEZxsp/bjY4jkTqDeVJfWI/df55icDhFDGylX59VeiSVudIgUUe5G1VqtgGJIXgqnkiLf5u+iaOSayFvxqhTrg==",
|
||||
"requires": {
|
||||
"primer-support": "4.7.2"
|
||||
}
|
||||
},
|
||||
"regex-escape": {
|
||||
"version": "3.4.9",
|
||||
"resolved": "https://registry.npmjs.org/regex-escape/-/regex-escape-3.4.9.tgz",
|
||||
"integrity": "sha512-Cv9rjwyQwVhn3L097ysanWsEElurmxDj6Cc4Ut23z7e6hzRbrNvF3Le7yAciMfuzyb0sZwSr0ZHunMNCIoy2/g=="
|
||||
},
|
||||
"sliced": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz",
|
||||
"integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E="
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"name": "profile-generator",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/github/profile-generator.git"
|
||||
},
|
||||
"author": "github",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/github/profile-generator/issues"
|
||||
},
|
||||
"homepage": "https://github.com/github/profile-generator#readme",
|
||||
"dependencies": {
|
||||
"github-calendar": "^1.3.1",
|
||||
"primer-core": "^6.10.9",
|
||||
"primer-marketing": "^6.3.3"
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
---
|
||||
---
|
||||
@import "primer-core/index";
|
||||
@import "primer-marketing/index";
|
||||
@import url('https://unpkg.com/primer/build/build.css');
|
||||
@import url('https://fonts.googleapis.com/css?family=Rubik:400,500,700,900');
|
||||
|
||||
body {
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "github-personal-website"
|
||||
spec.version = "0.1.1"
|
||||
spec.authors = ["Brandon Rosage"]
|
||||
spec.email = ["brandonrosage@github.com"]
|
||||
|
||||
spec.summary = "Jekyll theme for software developers intered in creating a personal website."
|
||||
spec.homepage = "http://github.dev."
|
||||
spec.license = "MIT"
|
||||
|
||||
spec.files = `git ls-files -z`.split("\x0").select do |f|
|
||||
f.match(%r{^(_(includes|layouts|sass)/|(LICENSE|README)((\.(txt|md|markdown)|$)))}i)
|
||||
end
|
||||
|
||||
spec.add_runtime_dependency "jekyll", "~> 3.7"
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 2.0.1"
|
||||
spec.add_development_dependency "rake", "~> 12.0"
|
||||
end
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
layout: sidebar
|
||||
layout: home
|
||||
---
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-19 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,157 +0,0 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
# add-subtract-date
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/add-subtract-date.svg)](https://www.npmjs.com/package/add-subtract-date) [![Downloads](https://img.shields.io/npm/dt/add-subtract-date.svg)](https://www.npmjs.com/package/add-subtract-date) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
> Add or subtract a specified time in a date object.
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save add-subtract-date
|
||||
|
||||
# Using yarn
|
||||
yarn add add-subtract-date
|
||||
```
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
const addSubtractDate = require("add-subtract-date");
|
||||
|
||||
var d = new Date(1989, 11, 20);
|
||||
|
||||
console.log(addSubtractDate.add(d, 2, "days"));
|
||||
// => Fri Dec 22 1989 00:00:00 GMT+0200 (EET)
|
||||
|
||||
console.log(addSubtractDate.subtract(d, 1, "day"));
|
||||
// => Thu Dec 21 1989 00:00:00 GMT+0200 (EET)
|
||||
|
||||
console.log(addSubtractDate.subtract(d, 1, "year"));
|
||||
// => Wed Dec 21 1988 00:00:00 GMT+0200 (EET)
|
||||
|
||||
console.log(addSubtractDate.add(d, 10, "hours"));
|
||||
// => Wed Dec 21 1988 10:00:00 GMT+0200 (EET)
|
||||
|
||||
console.log(addSubtractDate.add(d, 42, "minutes"));
|
||||
// => Wed Dec 21 1988 10:42:00 GMT+0200 (EET)
|
||||
|
||||
console.log(addSubtractDate.add(d, 7, "seconds"));
|
||||
// => Wed Dec 21 1988 10:42:07 GMT+0200 (EET)
|
||||
|
||||
console.log(addSubtractDate.add(d, 142, "milliseconds"));
|
||||
// => Wed Dec 21 1988 10:42:07 GMT+0200 (EET)
|
||||
|
||||
console.log(addSubtractDate.subtract(d, 1, "week"));
|
||||
// => Wed Dec 28 1988 10:42:07 GMT+0200 (EET)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `gen()`
|
||||
|
||||
|
||||
|
||||
|
||||
The module exports an object containing two methods: `add`
|
||||
|
||||
(goes in the future) and `subtract` (goes in the past).
|
||||
|
||||
They require the following arguments:
|
||||
|
||||
|
||||
- `d` (Date): The date object.
|
||||
- `count` (Number): How many years/months/etc to add/subtract.
|
||||
- `what` (String): What to add/subtract. Supported values are:
|
||||
|
||||
- `years`
|
||||
- `year`
|
||||
- `months`
|
||||
- `month`
|
||||
- `weeks`
|
||||
- `week`
|
||||
- `days`
|
||||
- `day`
|
||||
- `hours`
|
||||
- `hour`
|
||||
- `minutes`
|
||||
- `minute`
|
||||
- `seconds`
|
||||
- `second`
|
||||
- `milliseconds`
|
||||
- `millisecond`
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||
![](https://i.imgur.com/z6OQI95.png)
|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
|
||||
- [`daty`](https://github.com/IonicaBizau/daty#readme)—A tiny library to manage date objects.
|
||||
- [`github-calendar`](https://github.com/IonicaBizau/github-calendar#readme)—Embed your GitHub contributions calendar anywhere.
|
||||
- [`react-github-calendar-x`](https://github.com/xwl7001/react-github-calendar#readme) (by Xu Wenliang)—Embed your GitHub calendar in React App.
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(https%3A%2F%2Fionicabizau.net)&year=2015#license-mit
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
|
@ -1,49 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
function gen(add) {
|
||||
return function _(d, count, what) {
|
||||
count = add * count;
|
||||
switch (what) {
|
||||
case "years":
|
||||
case "year":
|
||||
d.setFullYear(d.getFullYear() + count);
|
||||
break;
|
||||
case "months":
|
||||
case "month":
|
||||
d.setMonth(d.getMonth() + count);
|
||||
break;
|
||||
case "weeks":
|
||||
case "week":
|
||||
return _(d, count * 7, "days");
|
||||
break;
|
||||
case "days":
|
||||
case "day":
|
||||
d.setDate(d.getDate() + count);
|
||||
break;
|
||||
case "hours":
|
||||
case "hour":
|
||||
d.setHours(d.getHours() + count);
|
||||
break;
|
||||
case "minutes":
|
||||
case "minute":
|
||||
d.setMinutes(d.getMinutes() + count);
|
||||
break;
|
||||
case "seconds":
|
||||
case "second":
|
||||
d.setSeconds(d.getSeconds() + count);
|
||||
break;
|
||||
case "milliseconds":
|
||||
case "millisecond":
|
||||
d.setMilliseconds(d.getMilliseconds() + count);
|
||||
break;
|
||||
default:
|
||||
throw new Error("Invalid range: " + what);
|
||||
}
|
||||
return d;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
add: gen(1),
|
||||
subtract: gen(-1)
|
||||
};
|
|
@ -1,113 +0,0 @@
|
|||
{
|
||||
"_from": "add-subtract-date@^1.0.5",
|
||||
"_id": "add-subtract-date@1.0.14",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-e070xJdKBEEdAgCJJm1nBSdGv4Y6C2LXP9PYHBUJPV/3eUkZ46bnnkzejmXmTFYyIsiouLPt26yGgsHZL7WDvg==",
|
||||
"_location": "/add-subtract-date",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "add-subtract-date@^1.0.5",
|
||||
"name": "add-subtract-date",
|
||||
"escapedName": "add-subtract-date",
|
||||
"rawSpec": "^1.0.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/github-calendar"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/add-subtract-date/-/add-subtract-date-1.0.14.tgz",
|
||||
"_shasum": "c2c2e707fa93c77ba3f70a010a6085eb13063d6f",
|
||||
"_spec": "add-subtract-date@^1.0.5",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/github-calendar",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "https://ionicabizau.net"
|
||||
},
|
||||
"blah": {
|
||||
"documentation": [
|
||||
{
|
||||
"p": [
|
||||
[
|
||||
"The module exports an object containing two methods: `add`",
|
||||
"(goes in the future) and `subtract` (goes in the past).",
|
||||
"They require the following arguments:"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"ul": [
|
||||
"`d` (Date): The date object.",
|
||||
"`count` (Number): How many years/months/etc to add/subtract.",
|
||||
[
|
||||
"`what` (String): What to add/subtract. Supported values are:",
|
||||
{
|
||||
"ul": [
|
||||
"`years`",
|
||||
"`year`",
|
||||
"`months`",
|
||||
"`month`",
|
||||
"`weeks`",
|
||||
"`week`",
|
||||
"`days`",
|
||||
"`day`",
|
||||
"`hours`",
|
||||
"`hour`",
|
||||
"`minutes`",
|
||||
"`minute`",
|
||||
"`seconds`",
|
||||
"`second`",
|
||||
"`milliseconds`",
|
||||
"`millisecond`"
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/add-subtract-date/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Add or subtract a specified time in a date object.",
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"scripts/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"bloggify.js",
|
||||
"bloggify.json",
|
||||
"bloggify/"
|
||||
],
|
||||
"homepage": "https://github.com/IonicaBizau/add-subtract-date#readme",
|
||||
"keywords": [
|
||||
"date",
|
||||
"add",
|
||||
"subtract"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "add-subtract-date",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/IonicaBizau/add-subtract-date.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.0.14"
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
# days [![NPM version](https://img.shields.io/npm/v/days.svg?style=flat)](https://www.npmjs.com/package/days) [![NPM monthly downloads](https://img.shields.io/npm/dm/days.svg?style=flat)](https://npmjs.org/package/days) [![NPM total downloads](https://img.shields.io/npm/dt/days.svg?style=flat)](https://npmjs.org/package/days)
|
||||
|
||||
> Days of the week.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save days
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var days = require('days');
|
||||
|
||||
console.log(days);
|
||||
//=> ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
|
||||
|
||||
console.log(days.abbr)
|
||||
//=> ['Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat']
|
||||
|
||||
console.log(days.short)
|
||||
//=> ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
|
||||
```
|
||||
|
||||
## Multi-language support
|
||||
|
||||
* English
|
||||
* French
|
||||
|
||||
### Usage
|
||||
|
||||
```js
|
||||
var days = require('days');
|
||||
|
||||
console.log(days.en);
|
||||
//=> ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
|
||||
|
||||
console.log(days.fr);
|
||||
//=> ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi']
|
||||
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 16 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 4 | [danielsalgadop](https://github.com/danielsalgadop) |
|
||||
| 2 | [Rawnly](https://github.com/Rawnly) |
|
||||
| 2 | [Sebastien-Meiffren](https://github.com/Sebastien-Meiffren) |
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._
|
|
@ -1,31 +0,0 @@
|
|||
/*!
|
||||
* days <https://github.com/jonschlinkert/days>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
// English
|
||||
module.exports.en = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
||||
module.exports.en.abbr = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
||||
module.exports.en.short = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
||||
|
||||
// French translation
|
||||
module.exports.fr = ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'];
|
||||
module.exports.fr.abbr = ['dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam'];
|
||||
module.exports.fr.short = ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'];
|
||||
|
||||
// Spanish translation
|
||||
module.exports.es = ['domingo', 'lunes', 'martes', 'miercoles', 'jueves', 'viernes', 'sabado'];
|
||||
module.exports.es.abbr = ['dom', 'lun', 'mar', 'mir', 'jue', 'vie', 'sab'];
|
||||
module.exports.es.short = ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sa'];
|
||||
|
||||
// Italian translation
|
||||
module.exports.it = ['Domenica', 'Lunedi', 'Martedi', 'Mercoledi', 'Giovedi', 'Venerdi', 'Sabato'];
|
||||
module.exports.it.abbr = ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'];
|
||||
module.exports.it.short = ['D', 'L', 'Ma', 'Me', 'G', 'V', 'S'];
|
||||
|
||||
// In order not to break compatibility
|
||||
module.exports = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
||||
module.exports.abbr = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
||||
module.exports.short = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
|
@ -1,110 +0,0 @@
|
|||
{
|
||||
"_from": "days@^1.0.1",
|
||||
"_id": "days@1.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-vzeIwVsEIyA35GH4+mPd4hjVDNI87wYANyZFs0BHjBr5kIBH5zEl7LfD6Wr4SFZca4D3CU9IH1w4DuZLlXzKRw==",
|
||||
"_location": "/days",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "days@^1.0.1",
|
||||
"name": "days",
|
||||
"escapedName": "days",
|
||||
"rawSpec": "^1.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/formatoid"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/days/-/days-1.1.1.tgz",
|
||||
"_shasum": "b039d1e5ad5335ca689401855546f02d4cfcb362",
|
||||
"_spec": "days@^1.0.1",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/formatoid",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/days/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Daniel Salgado Población",
|
||||
"url": "http://danielsalgado.com/wordpress35"
|
||||
},
|
||||
{
|
||||
"name": "Federico Vitale",
|
||||
"url": "https://rawnly.com"
|
||||
},
|
||||
{
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "http://twitter.com/jonschlinkert"
|
||||
},
|
||||
{
|
||||
"name": "Sebastien MEIFFREN",
|
||||
"url": "http://www.commande-online.fr"
|
||||
}
|
||||
],
|
||||
"deprecated": false,
|
||||
"description": "Days of the week.",
|
||||
"devDependencies": {
|
||||
"gulp-format-md": "^0.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/jonschlinkert/days",
|
||||
"keywords": [
|
||||
"calendar",
|
||||
"date",
|
||||
"day",
|
||||
"days",
|
||||
"duration",
|
||||
"friday",
|
||||
"monday",
|
||||
"now",
|
||||
"saturday",
|
||||
"sunday",
|
||||
"thursday",
|
||||
"time",
|
||||
"timespan",
|
||||
"tuesday",
|
||||
"wednesday",
|
||||
"week",
|
||||
"weekday"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "days",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jonschlinkert/days.git"
|
||||
},
|
||||
"verb": {
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
},
|
||||
"related": {
|
||||
"list": []
|
||||
},
|
||||
"reflinks": [
|
||||
"verb",
|
||||
"verb-generate-readme"
|
||||
]
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-19 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,178 +0,0 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
[![elly](http://i.imgur.com/hQjyLBz.png)](#)
|
||||
|
||||
# elly
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/elly.svg)](https://www.npmjs.com/package/elly) [![Downloads](https://img.shields.io/npm/dt/elly.svg)](https://www.npmjs.com/package/elly) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
> A tiny library for creating and selecting DOM elements.
|
||||
|
||||
## Is this a jQuery alternative?
|
||||
|
||||
|
||||
Well, in many cases yes. *elly* is a tiny wrapper around the `querySelector`, `querySelectorAll` and `document.createElement`, so, it basically can select and create DOM elements.
|
||||
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
|
||||
Check out the [`dist`](/dist) directory to download the needed files and include them on your page.
|
||||
|
||||
If you're using this module in a CommonJS environment, you can install it using `npm` or `yarn` and `require` it:
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save elly
|
||||
|
||||
# Using yarn
|
||||
yarn add elly
|
||||
```
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<script type="text/javascript" src="../dist/elly.min.js"></script>
|
||||
<title>Elly Example</title>
|
||||
</head>
|
||||
<body>
|
||||
<ul class="my-list">
|
||||
<li>1</li>
|
||||
<li>2</li>
|
||||
<li>3</li>
|
||||
</ul>
|
||||
<script>
|
||||
// Select the list element
|
||||
var $myList = $(".my-list");
|
||||
|
||||
// A new element
|
||||
$myList.appendChild(
|
||||
$("<li>", {
|
||||
"class": "new-item"
|
||||
, text: "4"
|
||||
})
|
||||
);
|
||||
// <ul class="my-list">
|
||||
// <li>1</li>
|
||||
// <li>2</li>
|
||||
// <li>3</li>
|
||||
// <li class="new-item">4</li>
|
||||
// </ul>
|
||||
|
||||
// Select all the list items and remove the first one.
|
||||
$.$$(".my-list > li")[0].remove();
|
||||
// <ul class="my-list">
|
||||
// <li>2</li>
|
||||
// <li>3</li>
|
||||
// <li class="new-item">4</li>
|
||||
// </ul>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `elly(input, contextOrAttributes)`
|
||||
Selects the DOM elements based on the provided selector. If there is no
|
||||
commonjs/module environment, the `$` global variable will be created.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String|HTMLElement** `input`: The element selector (e.g. `'#my-id > .my-class'`), the element tag you want to create
|
||||
(e.g. `'<ul>'`) or the HTML element (will be returned by the function).
|
||||
- **Object|HTMLElement** `contextOrAttributes`:
|
||||
|
||||
#### Return
|
||||
- **HTMLElement** The HTMLElement that was provided or selected.
|
||||
|
||||
### `elly.$$(selector, context)`
|
||||
Selects multiple elements. Note that if there is no commonjs/module environment, you will access this function using `$.$$`.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String** `selector`: The DOM query selector.
|
||||
- **HTMLElement** `context`: The element context/container. Defaults to `document`.
|
||||
|
||||
#### Return
|
||||
- **Array** The array of elements.
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||
![](https://i.imgur.com/z6OQI95.png)
|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
|
||||
- [`bloggify-paypal-donate-popup`](https://github.com/Bloggify/bloggify-paypal-donate-popup#readme)—A plugin to display a PayPal donation popup on the page.
|
||||
- [`bloggify-social`](https://github.com/Bloggify/social) (by Bloggify)—A Bloggify plugin for sharing articles on social networks.
|
||||
- [`dom-repeater`](https://github.com/IonicaBizau/dom-repeater#readme)—Render lists in DOM easily.
|
||||
- [`github-calendar`](https://github.com/IonicaBizau/github-calendar#readme)—Embed your GitHub contributions calendar anywhere.
|
||||
- [`mini-lightbox`](https://github.com/ionicabizau/mini-lightbox)—Minimalist image lightbox
|
||||
- [`react-github-calendar-x`](https://github.com/xwl7001/react-github-calendar#readme) (by Xu Wenliang)—Embed your GitHub calendar in React App.
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(https%3A%2F%2Fionicabizau.net)&year=2015#license-mit
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
|
@ -1,42 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
var _typeof = "function" == typeof Symbol && "symbol" == _typeof2(Symbol.iterator) ? function (e) {
|
||||
return typeof e === "undefined" ? "undefined" : _typeof2(e);
|
||||
} : function (e) {
|
||||
return e && "function" == typeof Symbol && e.constructor === Symbol ? "symbol" : typeof e === "undefined" ? "undefined" : _typeof2(e);
|
||||
};!function (e) {
|
||||
if ("object" === ("undefined" == typeof exports ? "undefined" : _typeof(exports)) && "undefined" != typeof module) module.exports = e();else if ("function" == typeof define && define.amd) define([], e);else {
|
||||
var t;t = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, t.$ = e();
|
||||
}
|
||||
}(function () {
|
||||
return function e(t, n, o) {
|
||||
function r(i, u) {
|
||||
if (!n[i]) {
|
||||
if (!t[i]) {
|
||||
var c = "function" == typeof require && require;if (!u && c) return c(i, !0);if (f) return f(i, !0);var d = new Error("Cannot find module '" + i + "'");throw d.code = "MODULE_NOT_FOUND", d;
|
||||
}var l = n[i] = { exports: {} };t[i][0].call(l.exports, function (e) {
|
||||
var n = t[i][1][e];return r(n ? n : e);
|
||||
}, l, l.exports, e, t, n, o);
|
||||
}return n[i].exports;
|
||||
}for (var f = "function" == typeof require && require, i = 0; i < o.length; i++) {
|
||||
r(o[i]);
|
||||
}return r;
|
||||
}({ 1: [function (e, t) {
|
||||
function n(e, t) {
|
||||
return "string" == typeof e ? "<" === e.charAt(0) ? (e = document.createElement(e.slice(1, -1)), o(t || {}, function (t, n) {
|
||||
switch (n) {case "text":
|
||||
return void (e.textContent = t);case "html":
|
||||
return void (e.innerHTML = t);}e.setAttribute(n, t);
|
||||
}), e) : (t = t || document, t.querySelector(e)) : e;
|
||||
}var o = e("iterate-object");n.$$ = function (e, t) {
|
||||
return t = t || document, t.querySelectorAll(e);
|
||||
}, t.exports = n;
|
||||
}, { "iterate-object": 2 }], 2: [function (e, t) {
|
||||
function n(e, t) {
|
||||
var n = 0,
|
||||
o = [];if (Array.isArray(e)) for (; n < e.length && t(e[n], n, e) !== !1; ++n) {} else if ("object" === ("undefined" == typeof e ? "undefined" : _typeof(e)) && null !== e) for (o = Object.keys(e); n < o.length && t(e[o[n]], o[n], e) !== !1; ++n) {}
|
||||
}t.exports = n;
|
||||
}, {}] }, {}, [1])(1);
|
||||
});
|
|
@ -1,63 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var iterateObj = require("iterate-object"),
|
||||
sliced = require("sliced");
|
||||
|
||||
/**
|
||||
* elly
|
||||
* Selects the DOM elements based on the provided selector. If there is no
|
||||
* commonjs/module environment, the `$` global variable will be created.
|
||||
*
|
||||
* @name elly
|
||||
* @function
|
||||
* @param {String|HTMLElement} input The element selector (e.g.
|
||||
* `'#my-id > .my-class'`), the element tag you want to create
|
||||
* (e.g. `'<ul>'`) or the HTML element (will be returned by the function).
|
||||
* @param {Object|HTMLElement} contextOrAttributes
|
||||
* @returns {HTMLElement} The HTMLElement that was provided or selected.
|
||||
*/
|
||||
function $(input, contextOrAttributes) {
|
||||
if (typeof input === "string") {
|
||||
if (input.charAt(0) === "<") {
|
||||
input = document.createElement(input.slice(1, -1));
|
||||
iterateObj(contextOrAttributes || {}, function (value, name) {
|
||||
|
||||
switch (name) {
|
||||
case "text":
|
||||
input.textContent = value;
|
||||
return;
|
||||
case "html":
|
||||
input.innerHTML = value;
|
||||
return;
|
||||
}
|
||||
|
||||
input.setAttribute(name, value);
|
||||
});
|
||||
return input;
|
||||
} else {
|
||||
contextOrAttributes = contextOrAttributes || document;
|
||||
return contextOrAttributes.querySelector(input);
|
||||
}
|
||||
}
|
||||
return input;
|
||||
};
|
||||
|
||||
/**
|
||||
* elly.$$
|
||||
* Selects multiple elements. Note that if there is no commonjs/module environment, you will access this function using `$.$$`.
|
||||
*
|
||||
* @name elly.$$
|
||||
* @function
|
||||
* @param {String} selector The DOM query selector.
|
||||
* @param {HTMLElement} context The element context/container. Defaults to `document`.
|
||||
* @returns {Array} The array of elements.
|
||||
*/
|
||||
$.$$ = function (selector, context) {
|
||||
if (typeof selector === "string") {
|
||||
context = context || document;
|
||||
return sliced(context.querySelectorAll(selector));
|
||||
}
|
||||
return [selector];
|
||||
};
|
||||
|
||||
module.exports = $;
|
|
@ -1,91 +0,0 @@
|
|||
{
|
||||
"_from": "elly@^1.0.0",
|
||||
"_id": "elly@1.1.10",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-CXlhCGIzVjX1SLPttmq2fo7wsOlfPMsxqf8rIbpFSkNWC+U8Nuldo6rG6oeFiBY9+8e7YcizwDnyK72APWH+dQ==",
|
||||
"_location": "/elly",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "elly@^1.0.0",
|
||||
"name": "elly",
|
||||
"escapedName": "elly",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/github-calendar"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/elly/-/elly-1.1.10.tgz",
|
||||
"_shasum": "15f3e43c81327ea927802a09508e60c712b81c9b",
|
||||
"_spec": "elly@^1.0.0",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/github-calendar",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "https://ionicabizau.net"
|
||||
},
|
||||
"blah": {
|
||||
"description": [
|
||||
{
|
||||
"h2": "Is this a jQuery alternative?"
|
||||
},
|
||||
{
|
||||
"p": "Well, in many cases yes. *elly* is a tiny wrapper around the `querySelector`, `querySelectorAll` and `document.createElement`, so, it basically can select and create DOM elements."
|
||||
}
|
||||
],
|
||||
"examplePath": "index.html",
|
||||
"h_img": "http://i.imgur.com/hQjyLBz.png"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/elly/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"iterate-object": "^1.3.2",
|
||||
"sliced": "^1.0.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A tiny library for creating and selecting DOM elements.",
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"scripts/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"bloggify.js",
|
||||
"bloggify.json",
|
||||
"bloggify/"
|
||||
],
|
||||
"homepage": "https://github.com/IonicaBizau/elly#readme",
|
||||
"keywords": [
|
||||
"elly",
|
||||
"a",
|
||||
"tiny",
|
||||
"library",
|
||||
"for",
|
||||
"creating",
|
||||
"and",
|
||||
"selecting",
|
||||
"dom",
|
||||
"elements"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "elly",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/IonicaBizau/elly.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.1.10"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-19 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,123 +0,0 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
# fillo
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/fillo.svg)](https://www.npmjs.com/package/fillo) [![Downloads](https://img.shields.io/npm/dt/fillo.svg)](https://www.npmjs.com/package/fillo) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
> Fill a value with characters to the given size.
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save fillo
|
||||
|
||||
# Using yarn
|
||||
yarn add fillo
|
||||
```
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
const fillo = require("fillo");
|
||||
|
||||
// Fill with with zeros (default behavior)
|
||||
console.log(fillo(7));
|
||||
// => "07"
|
||||
|
||||
console.log(fillo(142));
|
||||
// => "142"
|
||||
|
||||
console.log(fillo(42, 5));
|
||||
// => "00042"
|
||||
|
||||
console.log(fillo(42, 4, "#"));
|
||||
// => "##42"
|
||||
```
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `fillo(what, size, ch)`
|
||||
Fill additional characters at the beginning of the string.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String|Number** `what`: The input snippet (number, string or anything that can be stringified).
|
||||
- **Number** `size`: The width of the final string (default: `2`).
|
||||
- **String** `ch`: The character to repeat (default: `"0"`).
|
||||
|
||||
#### Return
|
||||
- **String** The input value with filled characters.
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||
![](https://i.imgur.com/z6OQI95.png)
|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
|
||||
- [`flight-tracker`](https://github.com/IonicaBizau/flight-tracker#readme)—A flight tracker in your command line.
|
||||
- [`formatoid`](https://github.com/IonicaBizau/formatoid#readme)—Tiny and fast module for formatting date objects.
|
||||
- [`timer-app`](https://github.com/IonicaBizau/timer-app#readme)—A simple timer application.
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(https%3A%2F%2Fionicabizau.net)&year=2015#license-mit
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
|
@ -1,20 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
/**
|
||||
* fillo
|
||||
* Fill additional characters at the beginning of the string.
|
||||
*
|
||||
* @name fillo
|
||||
* @function
|
||||
* @param {String|Number} what The input snippet (number, string or anything that can be stringified).
|
||||
* @param {Number} size The width of the final string (default: `2`).
|
||||
* @param {String} ch The character to repeat (default: `"0"`).
|
||||
* @return {String} The input value with filled characters.
|
||||
*/
|
||||
module.exports = function fillo(what, size, ch) {
|
||||
size = size || 2;
|
||||
ch = ch || "0";
|
||||
what = what.toString();
|
||||
var howMany = size - what.length;
|
||||
return (howMany <= 0 ? "" : ch.repeat(howMany)) + what;
|
||||
};
|
|
@ -1,72 +0,0 @@
|
|||
{
|
||||
"_from": "fillo@^1.0.0",
|
||||
"_id": "fillo@1.0.12",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-WjV09RN7NEp1EazSNKJVZCVHeWYj4MNyb4HX1BAyrW4j0OW2UPJukP4SUkJt9Nj7gWgyD6avK0mH5bjwOZFViw==",
|
||||
"_location": "/fillo",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "fillo@^1.0.0",
|
||||
"name": "fillo",
|
||||
"escapedName": "fillo",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/formatoid"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/fillo/-/fillo-1.0.12.tgz",
|
||||
"_shasum": "27a0f2793fcbb08dbd6ddb6568deb53896511aea",
|
||||
"_spec": "fillo@^1.0.0",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/formatoid",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "https://ionicabizau.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/fillo/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Fill a value with characters to the given size.",
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"scripts/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"bloggify.js",
|
||||
"bloggify.json",
|
||||
"bloggify/"
|
||||
],
|
||||
"homepage": "https://github.com/IonicaBizau/fillo#readme",
|
||||
"keywords": [
|
||||
"fill",
|
||||
"pad",
|
||||
"zero",
|
||||
"chars"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "fillo",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/IonicaBizau/fillo.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.0.12"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-19 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,173 +0,0 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
# formatoid
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/formatoid.svg)](https://www.npmjs.com/package/formatoid) [![Downloads](https://img.shields.io/npm/dt/formatoid.svg)](https://www.npmjs.com/package/formatoid) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
> Tiny and fast module for formatting date objects.
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save formatoid
|
||||
|
||||
# Using yarn
|
||||
yarn add formatoid
|
||||
```
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
const formatoid = require("formatoid");
|
||||
|
||||
var d = new Date(1989, 11, 21);
|
||||
|
||||
console.log(formatoid(d, "MM/DD/YYYY, h:mm"));
|
||||
// => 12/20/1989, 12:00
|
||||
|
||||
console.log(formatoid(d, "MMMM D, YYYY"));
|
||||
// => December 20, 1989
|
||||
|
||||
console.log(formatoid(d, "dddd, MMMM, D, YYYY h:m A"));
|
||||
// => Wednesday, December, 20, 1989 12:0 AM
|
||||
|
||||
console.log(formatoid(d, "YYYYMMDDT0HHMMSSZ"));
|
||||
// => 19891221T0001200+02:00
|
||||
|
||||
d._useUTC = true;
|
||||
console.log(formatoid(d, "dddd, MMMM, D, YYYY h:m A"));
|
||||
// => 19891221T0001200+02:00
|
||||
```
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `formatoid(i, f)`
|
||||
Formats the date into a given format.
|
||||
|
||||
Usable format fields:
|
||||
|
||||
- **Years**
|
||||
- `YYYY` (e.g. `"2015"`)
|
||||
- `YY` (e.g. `"15"`)
|
||||
- **Months**
|
||||
- `MMMM` (e.g. `"January"`)
|
||||
- `MMM` (e.g. `"Jan"`)
|
||||
- `MM` (e.g. `"01"`)
|
||||
- `M` (e.g. `"1"`)
|
||||
- **Days**
|
||||
- `dddd` (e.g. `"Sunday"`)
|
||||
- `ddd` (e.g. `"Sun"`)
|
||||
- `dd` (e.g. `"Su"`)
|
||||
- `d` (e.g. `"Su"`)
|
||||
- **Dates**
|
||||
- `DD` (e.g. `"07"`)
|
||||
- `D` (e.g. `"7"`)
|
||||
- **AM/PM**
|
||||
- `A` (e.g. `"AM"`)
|
||||
- `a` (e.g. `"pm"`)
|
||||
- **Hours**
|
||||
- `hh` (e.g. `"07"`)–12 hour format
|
||||
- `h` (e.g. `"7"`)
|
||||
- `HH` (e.g. `"07"`)–24 hour format
|
||||
- `H` (e.g. `"7"`)
|
||||
- **Minutes**
|
||||
- `mm` (e.g. `"07"`)
|
||||
- `m` (e.g. `"7"`)
|
||||
- **Seconds**
|
||||
- `ss` (e.g. `"07"`)
|
||||
- `s` (e.g. `"7"`)
|
||||
- **Fractional seconds**
|
||||
- `S` (e.g. `0 1 2 3 ... 9`)
|
||||
- `SS` (e.g. `00 01 02 ... 98 99`)
|
||||
- `SS` (e.g. `000 001 002 ... 998 999`)
|
||||
- **Timezones**
|
||||
- `Z` (e.g. `-07:00 -06:00 ... +06:00 +07:00`)
|
||||
- `ZZ` (e.g. `-0700 -0600 ... +0600 +0700`)
|
||||
|
||||
#### Params
|
||||
|
||||
- **Date** `i`: The date object.
|
||||
- **String** `f`: The date format.
|
||||
|
||||
#### Return
|
||||
- **String** The formatted date (as string).
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||
![](https://i.imgur.com/z6OQI95.png)
|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
|
||||
- [`daty`](https://github.com/IonicaBizau/daty#readme)—A tiny library to manage date objects.
|
||||
- [`github-calendar`](https://github.com/IonicaBizau/github-calendar#readme)—Embed your GitHub contributions calendar anywhere.
|
||||
- [`react-github-calendar-x`](https://github.com/xwl7001/react-github-calendar#readme) (by Xu Wenliang)—Embed your GitHub calendar in React App.
|
||||
|
||||
## :sparkles: Related
|
||||
|
||||
- [`add-subtract-date`](https://github.com/IonicaBizau/add-subtract-date#readme)—Add or subtract a specified time in a date object.
|
||||
|
||||
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(https%3A%2F%2Fionicabizau.net)&year=2015#license-mit
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
|
@ -1,257 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var months = require("months"),
|
||||
days = require("days"),
|
||||
fillo = require("fillo"),
|
||||
ParseIt = require("parse-it").Parser;
|
||||
|
||||
var rules = {
|
||||
// Years
|
||||
/// 2015
|
||||
YYYY: function YYYY(i, utc) {
|
||||
if (utc) {
|
||||
return i.getUTCFullYear();
|
||||
}
|
||||
return i.getFullYear();
|
||||
}
|
||||
|
||||
// 15
|
||||
,
|
||||
YY: function YY(i, utc) {
|
||||
return rules.YYYY(i, utc) % 100;
|
||||
}
|
||||
|
||||
// Months
|
||||
// January
|
||||
,
|
||||
MMMM: function MMMM(i, utc) {
|
||||
if (utc) {
|
||||
return months[i.getUTCMonth()];
|
||||
}
|
||||
return months[i.getMonth()];
|
||||
}
|
||||
|
||||
// Jan
|
||||
,
|
||||
MMM: function MMM(i, utc) {
|
||||
if (utc) {
|
||||
return months.abbr[i.getUTCMonth()];
|
||||
}
|
||||
return months.abbr[i.getMonth()];
|
||||
}
|
||||
|
||||
// 01
|
||||
,
|
||||
MM: function MM(i, utc) {
|
||||
if (utc) {
|
||||
return fillo(i.getUTCMonth() + 1);
|
||||
}
|
||||
return fillo(i.getMonth() + 1);
|
||||
}
|
||||
|
||||
// 1
|
||||
,
|
||||
M: function M(i, utc) {
|
||||
if (utc) {
|
||||
return i.getUTCMonth() + 1;
|
||||
}
|
||||
return i.getMonth() + 1;
|
||||
}
|
||||
|
||||
// Days
|
||||
// Sunday
|
||||
,
|
||||
dddd: function dddd(i, utc) {
|
||||
return days[rules.d(i, utc)];
|
||||
}
|
||||
|
||||
// Sun
|
||||
,
|
||||
ddd: function ddd(i, utc) {
|
||||
return days.abbr[rules.d(i, utc)];
|
||||
}
|
||||
|
||||
// Su
|
||||
,
|
||||
dd: function dd(i, utc) {
|
||||
return days.short[rules.d(i, utc)];
|
||||
}
|
||||
|
||||
// 0
|
||||
,
|
||||
d: function d(i, utc) {
|
||||
if (utc) {
|
||||
return i.getUTCDay();
|
||||
}
|
||||
return i.getDay();
|
||||
}
|
||||
|
||||
// Dates
|
||||
// 06 Day in month
|
||||
,
|
||||
DD: function DD(i, utc) {
|
||||
return fillo(rules.D(i, utc));
|
||||
}
|
||||
|
||||
// 6 Day in month
|
||||
,
|
||||
D: function D(i, utc) {
|
||||
if (utc) {
|
||||
return i.getUTCDate();
|
||||
}
|
||||
return i.getDate();
|
||||
}
|
||||
|
||||
// AM/PM
|
||||
// AM/PM
|
||||
,
|
||||
A: function A(i, utc) {
|
||||
return rules.a(i, utc).toUpperCase();
|
||||
}
|
||||
|
||||
// am/pm
|
||||
,
|
||||
a: function a(i, utc) {
|
||||
return rules.H(i, utc) >= 12 ? "pm" : "am";
|
||||
}
|
||||
|
||||
// Hours
|
||||
// 08 Hour
|
||||
,
|
||||
hh: function hh(i, utc) {
|
||||
return fillo(rules.h(i, utc));
|
||||
}
|
||||
|
||||
// 8 Hour
|
||||
,
|
||||
h: function h(i, utc) {
|
||||
return rules.H(i, utc) % 12 || 12;
|
||||
}
|
||||
|
||||
// (alias)
|
||||
,
|
||||
HH: function HH(i, utc) {
|
||||
return fillo(rules.H(i, utc));
|
||||
}
|
||||
|
||||
// (alias)
|
||||
,
|
||||
H: function H(i, utc) {
|
||||
if (utc) {
|
||||
return i.getUTCHours();
|
||||
}
|
||||
return i.getHours();
|
||||
}
|
||||
|
||||
// Minutes
|
||||
// 09 Minute
|
||||
,
|
||||
mm: function mm(i, utc) {
|
||||
return fillo(rules.m(i, utc));
|
||||
}
|
||||
|
||||
// 9 Minute
|
||||
,
|
||||
m: function m(i, utc) {
|
||||
if (utc) {
|
||||
return i.getUTCMinutes();
|
||||
}
|
||||
return i.getMinutes();
|
||||
}
|
||||
|
||||
// Seconds
|
||||
// 09 Seconds
|
||||
,
|
||||
ss: function ss(i, utc) {
|
||||
return fillo(rules.s(i, utc));
|
||||
}
|
||||
|
||||
// 9 Seconds
|
||||
,
|
||||
s: function s(i, utc) {
|
||||
if (utc) {
|
||||
return i.getUTCSeconds();
|
||||
}
|
||||
return i.getSeconds();
|
||||
}
|
||||
|
||||
// Fractional seconds
|
||||
// 0 1 ... 8 9
|
||||
,
|
||||
S: function S(i, utc) {
|
||||
return Math.round(rules.s(i, utc) / 60 * 10);
|
||||
},
|
||||
SS: function SS(i, utc) {
|
||||
return fillo(rules.s(i, utc) / 60 * 100);
|
||||
},
|
||||
SSS: function SSS(i, utc) {
|
||||
return fillo(rules.s(i, utc) / 60 * 1000, 3);
|
||||
}
|
||||
|
||||
// Timezones
|
||||
,
|
||||
Z: function Z(i) {
|
||||
var offset = -i.getTimezoneOffset();
|
||||
return (offset >= 0 ? "+" : "-") + fillo(parseInt(offset / 60)) + ":" + fillo(offset % 60);
|
||||
},
|
||||
ZZ: function ZZ(i) {
|
||||
var offset = -i.getTimezoneOffset();
|
||||
return (offset >= 0 ? "+" : "-") + fillo(parseInt(offset / 60)) + fillo(offset % 60);
|
||||
}
|
||||
};
|
||||
|
||||
var parser = new ParseIt(rules);
|
||||
|
||||
/**
|
||||
* formatoid
|
||||
* Formats the date into a given format.
|
||||
*
|
||||
* Usable format fields:
|
||||
*
|
||||
* - **Years**
|
||||
* - `YYYY` (e.g. `"2015"`)
|
||||
* - `YY` (e.g. `"15"`)
|
||||
* - **Months**
|
||||
* - `MMMM` (e.g. `"January"`)
|
||||
* - `MMM` (e.g. `"Jan"`)
|
||||
* - `MM` (e.g. `"01"`)
|
||||
* - `M` (e.g. `"1"`)
|
||||
* - **Days**
|
||||
* - `dddd` (e.g. `"Sunday"`)
|
||||
* - `ddd` (e.g. `"Sun"`)
|
||||
* - `dd` (e.g. `"Su"`)
|
||||
* - `d` (e.g. `"Su"`)
|
||||
* - **Dates**
|
||||
* - `DD` (e.g. `"07"`)
|
||||
* - `D` (e.g. `"7"`)
|
||||
* - **AM/PM**
|
||||
* - `A` (e.g. `"AM"`)
|
||||
* - `a` (e.g. `"pm"`)
|
||||
* - **Hours**
|
||||
* - `hh` (e.g. `"07"`)–12 hour format
|
||||
* - `h` (e.g. `"7"`)
|
||||
* - `HH` (e.g. `"07"`)–24 hour format
|
||||
* - `H` (e.g. `"7"`)
|
||||
* - **Minutes**
|
||||
* - `mm` (e.g. `"07"`)
|
||||
* - `m` (e.g. `"7"`)
|
||||
* - **Seconds**
|
||||
* - `ss` (e.g. `"07"`)
|
||||
* - `s` (e.g. `"7"`)
|
||||
* - **Fractional seconds**
|
||||
* - `S` (e.g. `0 1 2 3 ... 9`)
|
||||
* - `SS` (e.g. `00 01 02 ... 98 99`)
|
||||
* - `SS` (e.g. `000 001 002 ... 998 999`)
|
||||
* - **Timezones**
|
||||
* - `Z` (e.g. `-07:00 -06:00 ... +06:00 +07:00`)
|
||||
* - `ZZ` (e.g. `-0700 -0600 ... +0600 +0700`)
|
||||
*
|
||||
* @name formatoid
|
||||
* @function
|
||||
* @param {Date} i The date object.
|
||||
* @param {String} f The date format.
|
||||
* @return {String} The formatted date (as string).
|
||||
*/
|
||||
module.exports = function formatoid(i, f) {
|
||||
return parser.run(f, [i, i._useUTC]);
|
||||
};
|
|
@ -1,81 +0,0 @@
|
|||
{
|
||||
"_from": "formatoid@^1.0.3",
|
||||
"_id": "formatoid@1.2.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-CkI0aK01nKhHoFZByDKw/yrNPy+g56DNIEmlq0Q67grdR/LLV8Orc9gsTGVP7XufM3bZg8iuD5UsVfkOdJo2yg==",
|
||||
"_location": "/formatoid",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "formatoid@^1.0.3",
|
||||
"name": "formatoid",
|
||||
"escapedName": "formatoid",
|
||||
"rawSpec": "^1.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/github-calendar"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/formatoid/-/formatoid-1.2.3.tgz",
|
||||
"_shasum": "f9c1628fecbdfb56e422e5000cd2e81c1710589f",
|
||||
"_spec": "formatoid@^1.0.3",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/github-calendar",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "https://ionicabizau.net"
|
||||
},
|
||||
"blah": {
|
||||
"related": [
|
||||
"add-subtract-date"
|
||||
]
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/formatoid/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"days": "^1.0.1",
|
||||
"fillo": "^1.0.0",
|
||||
"months": "^1.0.0",
|
||||
"parse-it": "^1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Tiny and fast module for formatting date objects.",
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"scripts/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"bloggify.js",
|
||||
"bloggify.json",
|
||||
"bloggify/"
|
||||
],
|
||||
"homepage": "https://github.com/IonicaBizau/formatoid#readme",
|
||||
"keywords": [
|
||||
"format",
|
||||
"date"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "formatoid",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/IonicaBizau/formatoid.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.2.3"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016-19 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,108 +0,0 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
# github-calendar-legend
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/github-calendar-legend.svg)](https://www.npmjs.com/package/github-calendar-legend) [![Downloads](https://img.shields.io/npm/dt/github-calendar-legend.svg)](https://www.npmjs.com/package/github-calendar-legend) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
> The GitHub contributions calendar colors.
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save github-calendar-legend
|
||||
|
||||
# Using yarn
|
||||
yarn add github-calendar-legend
|
||||
```
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
const legend = require("github-calendar-legend");
|
||||
|
||||
console.log(legend);
|
||||
// => [ "#eee", "#d6e685", "#8cc665", "#44a340", "#1e6823" ]
|
||||
|
||||
console.log(legend.indexOf("#eee"));
|
||||
// => 0
|
||||
|
||||
console.log(legend[4]);
|
||||
// => "#1e6823"
|
||||
```
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### exports
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||
![](https://i.imgur.com/z6OQI95.png)
|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
|
||||
- [`git-stats-html`](https://github.com/IonicaBizau/git-stats-html#readme)—Turn git-stats result into HTML output.
|
||||
- [`github-calendar-parser`](https://github.com/IonicaBizau/github-calendar-parser#readme)—Parses the GitHub contributions calendar SVG code into JSON.
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(https%3A%2F%2Fionicabizau.net)&year=2016#license-mit
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
|
@ -1,3 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = ["#eee", "#d6e685", "#8cc665", "#44a340", "#1e6823"];
|
|
@ -1,74 +0,0 @@
|
|||
{
|
||||
"_from": "github-calendar-legend@^1.0.0",
|
||||
"_id": "github-calendar-legend@1.0.10",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-dDfX2Hvl98mSNbM9jRsZoZ0STb/AJcaf8ofRGXpH2oHtiQ73IlL8LFzOUzp49xSTFf0XYBs4DCXEhgbh+Fir2A==",
|
||||
"_location": "/github-calendar-legend",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "github-calendar-legend@^1.0.0",
|
||||
"name": "github-calendar-legend",
|
||||
"escapedName": "github-calendar-legend",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/github-calendar-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/github-calendar-legend/-/github-calendar-legend-1.0.10.tgz",
|
||||
"_shasum": "bbfad7332f155ad482abb61d4c6122b0cd13e986",
|
||||
"_spec": "github-calendar-legend@^1.0.0",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/github-calendar-parser",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "https://ionicabizau.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/github-calendar-legend/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "The GitHub contributions calendar colors.",
|
||||
"devDependencies": {
|
||||
"tester": "^1.3.0"
|
||||
},
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"scripts/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"bloggify.js",
|
||||
"bloggify.json",
|
||||
"bloggify/"
|
||||
],
|
||||
"homepage": "https://github.com/IonicaBizau/github-calendar-legend#readme",
|
||||
"keywords": [
|
||||
"github",
|
||||
"calendar",
|
||||
"legend"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "github-calendar-legend",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/IonicaBizau/github-calendar-legend.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"version": "1.0.10"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016-19 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,159 +0,0 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
# github-calendar-parser
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/github-calendar-parser.svg)](https://www.npmjs.com/package/github-calendar-parser) [![Downloads](https://img.shields.io/npm/dt/github-calendar-parser.svg)](https://www.npmjs.com/package/github-calendar-parser) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
> Parses the GitHub contributions calendar SVG code into JSON.
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save github-calendar-parser
|
||||
|
||||
# Using yarn
|
||||
yarn add github-calendar-parser
|
||||
```
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
const parse = require("github-calendar-parser");
|
||||
|
||||
var svg = `<svg width="721" height="110" class="js-calendar-graph-svg">
|
||||
<g transform="translate(20, 20)">
|
||||
<g transform="translate(0, 0)">
|
||||
<rect class="day" width="11" height="11" y="39" fill="#1e6823" data-count="78" data-date="2014-12-31"/>
|
||||
<rect class="day" width="11" height="11" y="52" fill="#d6e685" data-count="6" data-date="2015-01-01"/>
|
||||
<rect class="day" width="11" height="11" y="65" fill="#d6e685" data-count="1" data-date="2015-01-02"/>
|
||||
<rect class="day" width="11" height="11" y="78" fill="#d6e685" data-count="21" data-date="2015-01-03"/>
|
||||
</g>
|
||||
<g transform="translate(13, 0)">
|
||||
<rect class="day" width="11" height="11" y="0" fill="#8cc665" data-count="40" data-date="2015-01-04"/>
|
||||
<rect class="day" width="11" height="11" y="13" fill="#8cc665" data-count="27" data-date="2015-01-05"/>
|
||||
<rect class="day" width="11" height="11" y="26" fill="#8cc665" data-count="27" data-date="2015-01-06"/>
|
||||
<rect class="day" width="11" height="11" y="39" fill="#44a340" data-count="57" data-date="2015-01-07"/>
|
||||
<rect class="day" width="11" height="11" y="52" fill="#8cc665" data-count="0" data-date="2015-01-08"/>
|
||||
<rect class="day" width="11" height="11" y="65" fill="#8cc665" data-count="3" data-date="2015-01-09"/>
|
||||
<rect class="day" width="11" height="11" y="78" fill="#d6e685" data-count="2" data-date="2015-01-10"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>`;
|
||||
|
||||
console.log(parse(svg));
|
||||
// =>
|
||||
// { last_year: 262,
|
||||
// longest_streak: 9,
|
||||
// longest_streak_range: [ 2014-12-31T00:00:00.000Z, 2015-01-07T00:00:00.000Z ],
|
||||
// current_streak: 2,
|
||||
// current_streak_range: [ 2015-01-09T00:00:00.000Z, 2015-01-10T00:00:00.000Z ],
|
||||
// weeks: [ [ [Object], [Object], [Object], [Object] ] ],
|
||||
// days:
|
||||
// [ { fill: '#1e6823',
|
||||
// date: 2014-12-31T00:00:00.000Z,
|
||||
// count: 78,
|
||||
// level: 4 },
|
||||
// ...
|
||||
// { fill: '#d6e685',
|
||||
// date: 2015-01-10T00:00:00.000Z,
|
||||
// count: 2,
|
||||
// level: 1 } ],
|
||||
// last_contributed: 2015-01-10T00:00:00.000Z }
|
||||
```
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `parseGitHubCalendarSvg(input)`
|
||||
Parses the SVG input (as string).
|
||||
|
||||
#### Params
|
||||
|
||||
- **String** `input`: The SVG code of the contributions calendar.
|
||||
|
||||
#### Return
|
||||
- **Object** An object containing:
|
||||
- `last_year` (Number): The total contributions in the last year.
|
||||
- `longest_streak` (Number): The longest streak.
|
||||
- `longest_streak_range` (Array): An array of two date objects representing the date range.
|
||||
- `current_streak` (Number): The current streak.
|
||||
- `current_streak_range` (Array): An array of two date objects representing the date range.
|
||||
- `days` (Array): An array of day objects:
|
||||
- `fill` (String): The hex color.
|
||||
- `date` (Date): The day date.
|
||||
- `count` (Number): The number of commits.
|
||||
- `level` (Number): A number between 0 and 4 (inclusive) representing the contribution level (more commits, higher value).
|
||||
- `weeks` (Array): The day objects grouped by weeks (arrays).
|
||||
- `last_contributed` (Date): The last contribution date.
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||
![](https://i.imgur.com/z6OQI95.png)
|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
|
||||
- [`github-calendar`](https://github.com/IonicaBizau/github-calendar#readme)—Embed your GitHub contributions calendar anywhere.
|
||||
- [`react-github-calendar-x`](https://github.com/xwl7001/react-github-calendar#readme) (by Xu Wenliang)—Embed your GitHub calendar in React App.
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(https%3A%2F%2Fionicabizau.net)&year=2016#license-mit
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
|
@ -1,96 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var githubCalendarLegend = require("github-calendar-legend");
|
||||
|
||||
/**
|
||||
* parseGitHubCalendarSvg
|
||||
* Parses the SVG input (as string).
|
||||
*
|
||||
* @name parseGitHubCalendarSvg
|
||||
* @function
|
||||
* @param {String} input The SVG code of the contributions calendar.
|
||||
* @return {Object} An object containing:
|
||||
*
|
||||
* - `last_year` (Number): The total contributions in the last year.
|
||||
* - `longest_streak` (Number): The longest streak.
|
||||
* - `longest_streak_range` (Array): An array of two date objects representing the date range.
|
||||
* - `current_streak` (Number): The current streak.
|
||||
* - `current_streak_range` (Array): An array of two date objects representing the date range.
|
||||
* - `days` (Array): An array of day objects:
|
||||
* - `fill` (String): The hex color.
|
||||
* - `date` (Date): The day date.
|
||||
* - `count` (Number): The number of commits.
|
||||
* - `level` (Number): A number between 0 and 4 (inclusive) representing the contribution level (more commits, higher value).
|
||||
* - `weeks` (Array): The day objects grouped by weeks (arrays).
|
||||
* - `last_contributed` (Date): The last contribution date.
|
||||
*/
|
||||
module.exports = function parseGitHubCalendarSvg(input) {
|
||||
|
||||
var data = {
|
||||
last_year: 0,
|
||||
longest_streak: -1,
|
||||
longest_streak_range: [],
|
||||
current_streak: 0,
|
||||
current_streak_range: [],
|
||||
weeks: [],
|
||||
days: [],
|
||||
last_contributed: null
|
||||
},
|
||||
lastWeek = [],
|
||||
updateLongestStreak = function updateLongestStreak() {
|
||||
if (data.current_streak > data.longest_streak) {
|
||||
data.longest_streak = data.current_streak;
|
||||
data.longest_streak_range[0] = data.current_streak_range[0];
|
||||
data.longest_streak_range[1] = data.current_streak_range[1];
|
||||
}
|
||||
};
|
||||
|
||||
input.split("\n").slice(2).map(function (c) {
|
||||
return c.trim();
|
||||
}).forEach(function (c) {
|
||||
if (c.startsWith("<g transform")) {
|
||||
return lastWeek.length && data.weeks.push(lastWeek) && (lastWeek = []);
|
||||
}
|
||||
|
||||
var fill = c.match(/fill="(#[a-z0-9]+)"/),
|
||||
date = c.match(/data-date="([0-9\-]+)"/),
|
||||
count = c.match(/data-count="([0-9]+)"/),
|
||||
level = null;
|
||||
|
||||
fill = fill && fill[1];
|
||||
date = date && date[1];
|
||||
count = count && +count[1];
|
||||
|
||||
if (!fill) {
|
||||
return;
|
||||
}
|
||||
|
||||
var obj = {
|
||||
fill: fill,
|
||||
date: new Date(date),
|
||||
count: count,
|
||||
level: githubCalendarLegend.indexOf(fill)
|
||||
};
|
||||
|
||||
if (data.current_streak === 0) {
|
||||
data.current_streak_range[0] = obj.date;
|
||||
}
|
||||
|
||||
if (obj.count) {
|
||||
++data.current_streak;
|
||||
data.last_year += obj.count;
|
||||
data.last_contributed = obj.date;
|
||||
data.current_streak_range[1] = obj.date;
|
||||
} else {
|
||||
updateLongestStreak();
|
||||
data.current_streak = 0;
|
||||
}
|
||||
|
||||
lastWeek.push(obj);
|
||||
data.days.push(obj);
|
||||
});
|
||||
|
||||
updateLongestStreak();
|
||||
|
||||
return data;
|
||||
};
|
|
@ -1,78 +0,0 @@
|
|||
{
|
||||
"_from": "github-calendar-parser@^1.1.3",
|
||||
"_id": "github-calendar-parser@1.1.10",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-muDJpHio2ATZ9WXqTjyrFitLxFlJyZTy/c0EtiNhOwPzUBW4zr3mnX1qoiZM8DkgbLAyZY5CoEno3GEXPDSMPQ==",
|
||||
"_location": "/github-calendar-parser",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "github-calendar-parser@^1.1.3",
|
||||
"name": "github-calendar-parser",
|
||||
"escapedName": "github-calendar-parser",
|
||||
"rawSpec": "^1.1.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.1.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/github-calendar"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/github-calendar-parser/-/github-calendar-parser-1.1.10.tgz",
|
||||
"_shasum": "25285db5dd8e15a1f23e2fd71c3f809d240ccb21",
|
||||
"_spec": "github-calendar-parser@^1.1.3",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/github-calendar",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "https://ionicabizau.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/github-calendar-parser/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"github-calendar-legend": "^1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Parses the GitHub contributions calendar SVG code into JSON.",
|
||||
"devDependencies": {},
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"scripts/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"bloggify.js",
|
||||
"bloggify.json",
|
||||
"bloggify/"
|
||||
],
|
||||
"homepage": "https://github.com/IonicaBizau/github-calendar-parser#readme",
|
||||
"keywords": [
|
||||
"github",
|
||||
"json",
|
||||
"contributions",
|
||||
"calendar",
|
||||
"parser",
|
||||
"svg"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "github-calendar-parser",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/IonicaBizau/github-calendar-parser.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.1.10"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016-19 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,137 +0,0 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
# github-calendar.js
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/github-calendar.svg)](https://www.npmjs.com/package/github-calendar) [![Downloads](https://img.shields.io/npm/dt/github-calendar.svg)](https://www.npmjs.com/package/github-calendar)
|
||||
|
||||
> Embed your GitHub contributions calendar anywhere.
|
||||
|
||||
|
||||
Everybody<sup><sup>well, haters gonna hate</sup></sup> loves GitHub and everybody loves stats. So, why not making the GitHub contributions calendar available for being embeded in your web pages? Now [you can](https://ionicabizau.github.io/github-calendar/example). :tada:
|
||||
|
||||
|
||||
[![](http://i.imgur.com/S1h8XoB.jpg)](https://ionicabizau.github.io/github-calendar/example)
|
||||
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
|
||||
Check out the [`dist`](/dist) directory to download the needed files and include them on your page.
|
||||
|
||||
If you're using this module in a CommonJS environment, you can install it using `npm` or `yarn` and `require` it:
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save github-calendar
|
||||
|
||||
# Using yarn
|
||||
yarn add github-calendar
|
||||
```
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `GitHubCalendar(container, username, options)`
|
||||
Brings the contributions calendar from GitHub (provided username) into your page.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String|HTMLElement** `container`: The calendar container (query selector or the element itself).
|
||||
- **String** `username`: The GitHub username.
|
||||
- **Object** `options`: An object containing the following fields:
|
||||
- `summary_text` (String): The text that appears under the calendar (defaults to: `"Summary of
|
||||
pull requests, issues opened, and commits made by <username>"`).
|
||||
- `proxy` (Function): A function that receives as argument an url (string) and should return the proxied url.
|
||||
The default is using [@izuzak](https://github.com/izuzak)'s [`urlreq`](https://github.com/izuzak/urlreq).
|
||||
- `global_stats` (Boolean): If `false`, the global stats (total, longest and current streaks) will not be calculated and displayed. By default this is enabled.
|
||||
- `responsive` (Boolean): If `true`, the graph is changed to scale with the container. Custom CSS should be applied to the element to scale it appropriately. By default this is disabled.
|
||||
|
||||
#### Return
|
||||
- **Promise** A promise returned by the `fetch()` call.
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||
![](https://i.imgur.com/z6OQI95.png)
|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
## :cake: Thanks
|
||||
|
||||
- Big thanks to [**@izuzak**](https://github.com/izuzak) for creating the [urlreq](https://github.com/izuzak/urlreq) project–the default proxy used by this library. :cake:
|
||||
- Part of the CSS code was taken from the GitHub profile page to offer the same experience. :art:
|
||||
|
||||
|
||||
|
||||
## :sparkles: Related
|
||||
|
||||
- [`github-profile-languages`](https://github.com/IonicaBizau/github-profile-languages)—Create a nice pie chart with the user's programming languages from their GitHub profile.
|
||||
- [`github-org-members.js`](https://github.com/IonicaBizau/github-org-members.js)—A JavaScript library for fetching and rendering in HTML the members of a GitHub organization.
|
||||
- [`gh-contributions`](https://github.com/IonicaBizau/github-contributions)—A tool that generates a repository which being pushed into your GitHub account creates a nice contributions calendar.
|
||||
- [`github-emojify`](https://github.com/IonicaBizau/github-emojify#readme)—Emojify your GitHub repository descriptions.
|
||||
- [`github-stats`](https://github.com/IonicaBizau/github-stats)—Visualize stats about GitHub users and projects in your terminal.
|
||||
- [`github-labeller`](https://github.com/IonicaBizau/github-labeller#readme)—Automagically create issue labels in your GitHub projects.
|
||||
- [`cli-gh-cal`](https://github.com/IonicaBizau/cli-gh-cal)—GitHub like calendar graphs in command line.
|
||||
- [`gh-destroy`](https://github.com/IonicaBizau/gh-destroy#readme)—Delete multiple GitHub repositories.
|
||||
- [`ship-release`](https://github.com/IonicaBizau/ship-release#readme)—Publish new versions on GitHub and npm with ease.
|
||||
- [`github-calendar-legend`](https://github.com/IonicaBizau/github-calendar-legend#readme)—The GitHub contributions calendar colors.
|
||||
- [`github-pr-branch-links`](https://github.com/IonicaBizau/github-pr-branch-links)—Open in a new tab the clicked branch on a pull request page.
|
||||
- [`github-emoji-form-submit`](https://github.com/IonicaBizau/github-emoji-form-submit#readme)—Autocomplete selected Emoji when submitting forms on GitHub.com.
|
||||
- [`gh-repeat`](https://github.com/IonicaBizau/gh-repeat#readme)—Repetitive actions on multiple GitHub repositories.
|
||||
- [`gh-repos`](https://github.com/IonicaBizau/gh-repos#readme)—Get one or all the owner repositories from GitHub.
|
||||
- [`github-old-header`](https://github.com/IonicaBizau/github-old-header)—Brings the old header links back.
|
||||
- [`gh.js`](https://github.com/IonicaBizau/gh.js)—Tiny GitHub API wrapper for server and client.
|
||||
- [`ghcal`](https://github.com/IonicaBizau/ghcal)—See the GitHub contributions calendar of a user in the command line.
|
||||
- [`sort-github-user-repos`](https://github.com/IonicaBizau/sort-github-user-repos#readme)—Sort GitHub repositories by stars for user.
|
||||
- [`github-calendar-parser`](https://github.com/IonicaBizau/github-calendar-parser#readme)—Parses the GitHub contributions calendar SVG code into JSON.
|
||||
- [`gh-notifier`](https://bitbucket.org/IonicaBizau/gh-notifier#readme)—Receive desktop notifications from your GitHub dashboard.
|
||||
- [`octimatch`](https://github.com/IonicaBizau/OctiMatch#readme)—A matching game with GitHub's Octicons.
|
||||
- [`github-portfolio`](https://github.com/IonicaBizau/github-portfolio#readme)—A tool to generate a portfolio using data from your Github projects.
|
||||
- [`gh-polyglot`](https://github.com/IonicaBizau/node-gh-polyglot)—Get language stats about GitHub users and repositories.
|
||||
- [`cli-github`](https://github.com/IonicaBizau/cli-github)—A fancy GitHub client for command line.
|
||||
- [`github-calendar`](https://github.com/IonicaBizau/github-calendar#readme)—Embed your GitHub contributions calendar anywhere.
|
||||
- [`git-stats`](https://github.com/IonicaBizau/git-stats)—Local git statistics including GitHub-like contributions calendars.
|
||||
- [`repository-downloader`](https://github.com/IonicaBizau/repository-downloader)—Download all the repositories from BitBucket and GitHub, including your account, teams and where you created pull requests.
|
||||
- [`github-colors`](https://github.com/IonicaBizau/github-colors)—GitHub colors and file extensions mapping
|
||||
|
||||
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(https%3A%2F%2Fionicabizau.net)&year=2016#license-mit
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
|
@ -1,125 +0,0 @@
|
|||
.calendar {
|
||||
font-family: Helvetica, arial;
|
||||
border: 1px solid #DDDDDD;
|
||||
border-radius: 3px;
|
||||
min-height: 243px;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.calendar-graph text.wday,
|
||||
.calendar-graph text.month {
|
||||
font-size: 10px;
|
||||
fill: #aaa;
|
||||
}
|
||||
|
||||
.contrib-legend {
|
||||
text-align: right;
|
||||
padding: 0 14px 10px 0;
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.contrib-legend .legend {
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
margin: 0 5px;
|
||||
position: relative;
|
||||
bottom: -1px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.contrib-legend .legend li {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.text-small {
|
||||
font-size: 12px;
|
||||
color: #767676;
|
||||
}
|
||||
|
||||
.calendar-graph {
|
||||
padding: 5px 0 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.contrib-column {
|
||||
padding: 15px 0;
|
||||
text-align: center;
|
||||
border-left: 1px solid #ddd;
|
||||
border-top: 1px solid #ddd;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.contrib-column-first {
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
.table-column {
|
||||
display: table-cell;
|
||||
width: 1%;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.contrib-number {
|
||||
font-weight: 300;
|
||||
line-height: 1.3em;
|
||||
font-size: 24px;
|
||||
display: block;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.calendar img.spinner {
|
||||
width: 70px;
|
||||
margin-top: 50px;
|
||||
min-height: 70px;
|
||||
}
|
||||
|
||||
.monospace {
|
||||
text-align: center;
|
||||
color: #000;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.monospace a {
|
||||
color: #1D75AB;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.contrib-footer {
|
||||
font-size: 11px;
|
||||
padding: 0 10px 12px;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.left.text-muted {
|
||||
float: left;
|
||||
margin-left: 9px;
|
||||
color: #767676;
|
||||
}
|
||||
.left.text-muted a {
|
||||
color: #4078c0;
|
||||
text-decoration: none;
|
||||
}
|
||||
.left.text-muted a:hover,
|
||||
.monospace a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h2.f4.text-normal.mb-3 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.float-left.text-gray {
|
||||
float: left;
|
||||
}
|
||||
#user-activity-overview{
|
||||
display:none;
|
||||
}
|
|
@ -1,127 +0,0 @@
|
|||
.calendar {
|
||||
width: 750px;
|
||||
font-family: Helvetica, arial;
|
||||
border: 1px solid #DDDDDD;
|
||||
border-radius: 3px;
|
||||
min-height: 243px;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.calendar-graph text.wday,
|
||||
.calendar-graph text.month {
|
||||
font-size: 10px;
|
||||
fill: #aaa;
|
||||
}
|
||||
|
||||
.contrib-legend {
|
||||
text-align: right;
|
||||
padding: 0 14px 10px 0;
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.contrib-legend .legend {
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
margin: 0 5px;
|
||||
position: relative;
|
||||
bottom: -1px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.contrib-legend .legend li {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.text-small {
|
||||
font-size: 12px;
|
||||
color: #767676;
|
||||
}
|
||||
|
||||
.calendar-graph {
|
||||
padding: 5px 0 0;
|
||||
height: 126px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.contrib-column {
|
||||
padding: 15px 0;
|
||||
text-align: center;
|
||||
border-left: 1px solid #ddd;
|
||||
border-top: 1px solid #ddd;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.contrib-column-first {
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
.table-column {
|
||||
display: table-cell;
|
||||
width: 1%;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.contrib-number {
|
||||
font-weight: 300;
|
||||
line-height: 1.3em;
|
||||
font-size: 24px;
|
||||
display: block;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.calendar img.spinner {
|
||||
width: 70px;
|
||||
margin-top: 50px;
|
||||
min-height: 70px;
|
||||
}
|
||||
|
||||
.monospace {
|
||||
text-align: center;
|
||||
color: #000;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.monospace a {
|
||||
color: #1D75AB;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.contrib-footer {
|
||||
font-size: 11px;
|
||||
padding: 0 10px 12px;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.left.text-muted {
|
||||
float: left;
|
||||
margin-left: 9px;
|
||||
color: #767676;
|
||||
}
|
||||
.left.text-muted a {
|
||||
color: #4078c0;
|
||||
text-decoration: none;
|
||||
}
|
||||
.left.text-muted a:hover,
|
||||
.monospace a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h2.f4.text-normal.mb-3 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.float-left.text-gray {
|
||||
float: left;
|
||||
}
|
||||
#user-activity-overview{
|
||||
display:none;
|
||||
}
|
|
@ -1,222 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
var _typeof = "function" == typeof Symbol && "symbol" == _typeof2(Symbol.iterator) ? function (e) {
|
||||
return typeof e === "undefined" ? "undefined" : _typeof2(e);
|
||||
} : function (e) {
|
||||
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e === "undefined" ? "undefined" : _typeof2(e);
|
||||
};!function (e) {
|
||||
if ("object" === ("undefined" == typeof exports ? "undefined" : _typeof(exports)) && "undefined" != typeof module) module.exports = e();else if ("function" == typeof define && define.amd) define([], e);else {
|
||||
var t;t = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, t.GitHubCalendar = e();
|
||||
}
|
||||
}(function () {
|
||||
return function () {
|
||||
function e(t, r, n) {
|
||||
function a(s, u) {
|
||||
if (!r[s]) {
|
||||
if (!t[s]) {
|
||||
var i = "function" == typeof require && require;if (!u && i) return i(s, !0);if (o) return o(s, !0);var c = new Error("Cannot find module '" + s + "'");throw c.code = "MODULE_NOT_FOUND", c;
|
||||
}var l = r[s] = { exports: {} };t[s][0].call(l.exports, function (e) {
|
||||
var r = t[s][1][e];return a(r || e);
|
||||
}, l, l.exports, e, t, r, n);
|
||||
}return r[s].exports;
|
||||
}for (var o = "function" == typeof require && require, s = 0; s < n.length; s++) {
|
||||
a(n[s]);
|
||||
}return a;
|
||||
}return e;
|
||||
}()({ 1: [function (e, t) {
|
||||
var r = e("github-calendar-parser"),
|
||||
n = e("elly"),
|
||||
a = e("add-subtract-date"),
|
||||
o = e("formatoid"),
|
||||
s = "MMM D, YYYY",
|
||||
u = "MMMM D";t.exports = function (e, t, i) {
|
||||
e = n(e), i = i || {}, i.summary_text = i.summary_text || 'Summary of pull requests, issues opened, and commits made by <a href="https://github.com/' + t + '" target="blank">@' + t + "</a>", i.responsive === !0 && e.classList.add("calendar-responsive"), i.global_stats === !1 && (e.style.minHeight = "175px"), i.proxy = i.proxy || function (e) {
|
||||
return "https://urlreq.appspot.com/req?method=GET&url=" + e;
|
||||
};var c = function l() {
|
||||
return fetch(i.proxy("https://github.com/" + t)).then(function (e) {
|
||||
return e.text();
|
||||
}).then(function (t) {
|
||||
var c = document.createElement("div");c.innerHTML = t;var d = c.querySelector(".js-yearly-contributions");if (n(".position-relative h2", d).remove(), d.querySelector(".float-left.text-gray").innerHTML = i.summary_text, d.querySelector("include-fragment")) setTimeout(l, 500);else {
|
||||
if (i.responsive === !0) {
|
||||
var f = d.querySelector("svg.js-calendar-graph-svg"),
|
||||
p = f.getAttribute("width"),
|
||||
b = f.getAttribute("height");f.removeAttribute("height"), f.setAttribute("width", "100%"), f.setAttribute("viewBox", "0 0 " + p + " " + b);
|
||||
}if (i.global_stats !== !1) {
|
||||
var m = r(n("svg", d).outerHTML),
|
||||
g = m.current_streak ? o(m.current_streak_range[0], u) + " – " + o(m.current_streak_range[1], u) : m.last_contributed ? "Last contributed in " + o(m.last_contributed, u) + "." : "Rock - Hard Place",
|
||||
h = m.longest_streak ? o(m.longest_streak_range[0], u) + " – " + o(m.longest_streak_range[1], u) : m.last_contributed ? "Last contributed in " + o(m.last_contributed, u) + "." : "Rock - Hard Place",
|
||||
y = n("<div>", { "class": "contrib-column contrib-column-first table-column", html: '<span class="text-muted">Contributions in the last year</span>\n <span class="contrib-number">' + m.last_year + ' total</span>\n <span class="text-muted">' + o(a.subtract(new Date(), 1, "year"), s) + " – " + o(new Date(), s) + "</span>" }),
|
||||
v = n("<div>", { "class": "contrib-column table-column", html: '<span class="text-muted">Longest streak</span>\n <span class="contrib-number">' + m.longest_streak + ' days</span>\n <span class="text-muted">' + h + "</span>" }),
|
||||
M = n("<div>", { "class": "contrib-column table-column", html: '<span class="text-muted">Current streak</span>\n <span class="contrib-number">' + m.current_streak + ' days</span>\n <span class="text-muted">' + g + "</span>" });d.appendChild(y), d.appendChild(v), d.appendChild(M);
|
||||
}e.innerHTML = d.innerHTML;
|
||||
}
|
||||
})["catch"](function (e) {
|
||||
return console.error(e);
|
||||
});
|
||||
};return c();
|
||||
};
|
||||
}, { "add-subtract-date": 2, elly: 4, formatoid: 6, "github-calendar-parser": 8 }], 2: [function (e, t) {
|
||||
function r(e) {
|
||||
return function t(r, n, a) {
|
||||
switch (n = e * n, a) {case "years":case "year":
|
||||
r.setFullYear(r.getFullYear() + n);break;case "months":case "month":
|
||||
r.setMonth(r.getMonth() + n);break;case "weeks":case "week":
|
||||
return t(r, 7 * n, "days");case "days":case "day":
|
||||
r.setDate(r.getDate() + n);break;case "hours":case "hour":
|
||||
r.setHours(r.getHours() + n);break;case "minutes":case "minute":
|
||||
r.setMinutes(r.getMinutes() + n);break;case "seconds":case "second":
|
||||
r.setSeconds(r.getSeconds() + n);break;case "milliseconds":case "millisecond":
|
||||
r.setMilliseconds(r.getMilliseconds() + n);break;default:
|
||||
throw new Error("Invalid range: " + a);}return r;
|
||||
};
|
||||
}t.exports = { add: r(1), subtract: r(-1) };
|
||||
}, {}], 3: [function (e, t) {
|
||||
t.exports.en = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], t.exports.en.abbr = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], t.exports.en["short"] = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], t.exports.fr = ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], t.exports.fr.abbr = ["dim", "lun", "mar", "mer", "jeu", "ven", "sam"], t.exports.fr["short"] = ["di", "lu", "ma", "me", "je", "ve", "sa"], t.exports.es = ["domingo", "lunes", "martes", "miercoles", "jueves", "viernes", "sabado"], t.exports.es.abbr = ["dom", "lun", "mar", "mir", "jue", "vie", "sab"], t.exports.es["short"] = ["do", "lu", "ma", "mi", "ju", "vi", "sa"], t.exports.it = ["Domenica", "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato"], t.exports.it.abbr = ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"], t.exports.it["short"] = ["D", "L", "Ma", "Me", "G", "V", "S"], t.exports = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], t.exports.abbr = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], t.exports["short"] = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
||||
}, {}], 4: [function (e, t) {
|
||||
function r(e, t) {
|
||||
return "string" == typeof e ? "<" === e.charAt(0) ? (e = document.createElement(e.slice(1, -1)), n(t || {}, function (t, r) {
|
||||
switch (r) {case "text":
|
||||
return void (e.textContent = t);case "html":
|
||||
return void (e.innerHTML = t);}e.setAttribute(r, t);
|
||||
}), e) : (t = t || document, t.querySelector(e)) : e;
|
||||
}var n = e("iterate-object"),
|
||||
a = e("sliced");r.$$ = function (e, t) {
|
||||
return "string" == typeof e ? (t = t || document, a(t.querySelectorAll(e))) : [e];
|
||||
}, t.exports = r;
|
||||
}, { "iterate-object": 9, sliced: 13 }], 5: [function (e, t) {
|
||||
t.exports = function (e, t, r) {
|
||||
t = t || 2, r = r || "0", e = e.toString();var n = t - e.length;return (0 >= n ? "" : r.repeat(n)) + e;
|
||||
};
|
||||
}, {}], 6: [function (e, t) {
|
||||
var r = e("months"),
|
||||
n = e("days"),
|
||||
a = e("fillo"),
|
||||
o = e("parse-it").Parser,
|
||||
s = { YYYY: function YYYY(e, t) {
|
||||
return t ? e.getUTCFullYear() : e.getFullYear();
|
||||
}, YY: function YY(e, t) {
|
||||
return s.YYYY(e, t) % 100;
|
||||
}, MMMM: function MMMM(e, t) {
|
||||
return t ? r[e.getUTCMonth()] : r[e.getMonth()];
|
||||
}, MMM: function MMM(e, t) {
|
||||
return t ? r.abbr[e.getUTCMonth()] : r.abbr[e.getMonth()];
|
||||
}, MM: function MM(e, t) {
|
||||
return a(t ? e.getUTCMonth() + 1 : e.getMonth() + 1);
|
||||
}, M: function M(e, t) {
|
||||
return t ? e.getUTCMonth() + 1 : e.getMonth() + 1;
|
||||
}, dddd: function dddd(e, t) {
|
||||
return n[s.d(e, t)];
|
||||
}, ddd: function ddd(e, t) {
|
||||
return n.abbr[s.d(e, t)];
|
||||
}, dd: function dd(e, t) {
|
||||
return n["short"][s.d(e, t)];
|
||||
}, d: function d(e, t) {
|
||||
return t ? e.getUTCDay() : e.getDay();
|
||||
}, DD: function DD(e, t) {
|
||||
return a(s.D(e, t));
|
||||
}, D: function D(e, t) {
|
||||
return t ? e.getUTCDate() : e.getDate();
|
||||
}, A: function A(e, t) {
|
||||
return s.a(e, t).toUpperCase();
|
||||
}, a: function a(e, t) {
|
||||
return s.H(e, t) >= 12 ? "pm" : "am";
|
||||
}, hh: function hh(e, t) {
|
||||
return a(s.h(e, t));
|
||||
}, h: function h(e, t) {
|
||||
return s.H(e, t) % 12 || 12;
|
||||
}, HH: function HH(e, t) {
|
||||
return a(s.H(e, t));
|
||||
}, H: function H(e, t) {
|
||||
return t ? e.getUTCHours() : e.getHours();
|
||||
}, mm: function mm(e, t) {
|
||||
return a(s.m(e, t));
|
||||
}, m: function m(e, t) {
|
||||
return t ? e.getUTCMinutes() : e.getMinutes();
|
||||
}, ss: function ss(e, t) {
|
||||
return a(s.s(e, t));
|
||||
}, s: function s(e, t) {
|
||||
return t ? e.getUTCSeconds() : e.getSeconds();
|
||||
}, S: function S(e, t) {
|
||||
return Math.round(s.s(e, t) / 60 * 10);
|
||||
}, SS: function SS(e, t) {
|
||||
return a(s.s(e, t) / 60 * 100);
|
||||
}, SSS: function SSS(e, t) {
|
||||
return a(s.s(e, t) / 60 * 1e3, 3);
|
||||
}, Z: function Z(e) {
|
||||
var t = -e.getTimezoneOffset();return (t >= 0 ? "+" : "-") + a(parseInt(t / 60)) + ":" + a(t % 60);
|
||||
}, ZZ: function ZZ(e) {
|
||||
var t = -e.getTimezoneOffset();return (t >= 0 ? "+" : "-") + a(parseInt(t / 60)) + a(t % 60);
|
||||
} },
|
||||
u = new o(s);t.exports = function (e, t) {
|
||||
return u.run(t, [e, e._useUTC]);
|
||||
};
|
||||
}, { days: 3, fillo: 5, months: 10, "parse-it": 11 }], 7: [function (e, t) {
|
||||
t.exports = ["#eee", "#d6e685", "#8cc665", "#44a340", "#1e6823"];
|
||||
}, {}], 8: [function (e, t) {
|
||||
var r = e("github-calendar-legend");t.exports = function (e) {
|
||||
var t = { last_year: 0, longest_streak: -1, longest_streak_range: [], current_streak: 0, current_streak_range: [], weeks: [], days: [], last_contributed: null },
|
||||
n = [],
|
||||
a = function a() {
|
||||
t.current_streak > t.longest_streak && (t.longest_streak = t.current_streak, t.longest_streak_range[0] = t.current_streak_range[0], t.longest_streak_range[1] = t.current_streak_range[1]);
|
||||
};return e.split("\n").slice(2).map(function (e) {
|
||||
return e.trim();
|
||||
}).forEach(function (e) {
|
||||
if (e.startsWith("<g transform")) return n.length && t.weeks.push(n) && (n = []);var o = e.match(/fill="(#[a-z0-9]+)"/),
|
||||
s = e.match(/data-date="([0-9\-]+)"/),
|
||||
u = e.match(/data-count="([0-9]+)"/);if (o = o && o[1], s = s && s[1], u = u && +u[1], o) {
|
||||
var i = { fill: o, date: new Date(s), count: u, level: r.indexOf(o) };0 === t.current_streak && (t.current_streak_range[0] = i.date), i.count ? (++t.current_streak, t.last_year += i.count, t.last_contributed = i.date, t.current_streak_range[1] = i.date) : (a(), t.current_streak = 0), n.push(i), t.days.push(i);
|
||||
}
|
||||
}), a(), t;
|
||||
};
|
||||
}, { "github-calendar-legend": 7 }], 9: [function (e, t) {
|
||||
function r(e, t) {
|
||||
var r = 0,
|
||||
n = [];if (Array.isArray(e)) for (; r < e.length && t(e[r], r, e) !== !1; ++r) {} else if ("object" === ("undefined" == typeof e ? "undefined" : _typeof(e)) && null !== e) for (n = Object.keys(e); r < n.length && t(e[n[r]], n[r], e) !== !1; ++r) {}
|
||||
}t.exports = r;
|
||||
}, {}], 10: [function (e, t) {
|
||||
t.exports = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], t.exports.abbr = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], t.exports.it = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], t.exports.abbr.it = ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], t.exports.de = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], t.exports.abbr.de = ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"];
|
||||
}, {}], 11: [function (e, t) {
|
||||
function r(e, t) {
|
||||
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
||||
}function n(e, t, r) {
|
||||
return new s(t).run(e, r);
|
||||
}var a = function () {
|
||||
function e(e, t) {
|
||||
for (var r = 0; r < t.length; r++) {
|
||||
var n = t[r];n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
|
||||
}
|
||||
}return function (t, r, n) {
|
||||
return r && e(t.prototype, r), n && e(t, n), t;
|
||||
};
|
||||
}(),
|
||||
o = e("regex-escape"),
|
||||
s = function () {
|
||||
function e(t) {
|
||||
r(this, e), this.obj = t || {}, this.re = new RegExp("^(" + Object.keys(t).map(o).join("|") + ")");
|
||||
}return a(e, [{ key: "run", value: function value(e, t) {
|
||||
var r = "";t = t || [];do {
|
||||
var n = e.match(this.re),
|
||||
a = n && n[1],
|
||||
o = a || e.charAt(0);if (a) {
|
||||
var s = this.obj[a];"function" == typeof s && (s = s.apply(this, t)), r += s;
|
||||
} else r += o;e = e.substring(o.length);
|
||||
} while (e);return r;
|
||||
} }]), e;
|
||||
}();n.Parser = s, t.exports = n;
|
||||
}, { "regex-escape": 12 }], 12: [function (e, t) {
|
||||
function r(e) {
|
||||
return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
||||
}r.proto = function () {
|
||||
return RegExp.escape = r, r;
|
||||
}, t.exports = r;
|
||||
}, {}], 13: [function (e, t) {
|
||||
t.exports = function (e, t, r) {
|
||||
var n = [],
|
||||
a = e.length;if (0 === a) return n;var o = 0 > t ? Math.max(0, t + a) : t || 0;for (void 0 !== r && (a = 0 > r ? r + a : r); a-- > o;) {
|
||||
n[a - o] = e[a];
|
||||
}return n;
|
||||
};
|
||||
}, {}] }, {}, [1])(1);
|
||||
});
|
|
@ -1,105 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var parse = require("github-calendar-parser"),
|
||||
$ = require("elly"),
|
||||
addSubtractDate = require("add-subtract-date"),
|
||||
formatoid = require("formatoid");
|
||||
|
||||
var DATE_FORMAT1 = "MMM D, YYYY",
|
||||
DATE_FORMAT2 = "MMMM D";
|
||||
|
||||
/**
|
||||
* GitHubCalendar
|
||||
* Brings the contributions calendar from GitHub (provided username) into your page.
|
||||
*
|
||||
* @name GitHubCalendar
|
||||
* @function
|
||||
* @param {String|HTMLElement} container The calendar container (query selector or the element itself).
|
||||
* @param {String} username The GitHub username.
|
||||
* @param {Object} options An object containing the following fields:
|
||||
*
|
||||
* - `summary_text` (String): The text that appears under the calendar (defaults to: `"Summary of
|
||||
* pull requests, issues opened, and commits made by <username>"`).
|
||||
* - `proxy` (Function): A function that receives as argument an url (string) and should return the proxied url.
|
||||
* The default is using [@izuzak](https://github.com/izuzak)'s [`urlreq`](https://github.com/izuzak/urlreq).
|
||||
* - `global_stats` (Boolean): If `false`, the global stats (total, longest and current streaks) will not be calculated and displayed. By default this is enabled.
|
||||
* - `responsive` (Boolean): If `true`, the graph is changed to scale with the container. Custom CSS should be applied to the element to scale it appropriately. By default this is disabled.
|
||||
*
|
||||
* @return {Promise} A promise returned by the `fetch()` call.
|
||||
*/
|
||||
module.exports = function GitHubCalendar(container, username, options) {
|
||||
|
||||
container = $(container);
|
||||
|
||||
options = options || {};
|
||||
options.summary_text = options.summary_text || "Summary of pull requests, issues opened, and commits made by <a href=\"https://github.com/" + username + "\" target=\"blank\">@" + username + "</a>";
|
||||
|
||||
if (options.global_stats === false) {
|
||||
container.style.minHeight = "175px";
|
||||
}
|
||||
|
||||
// We need a proxy for CORS
|
||||
// Thanks, @izuzak (https://github.com/izuzak/urlreq)
|
||||
options.proxy = options.proxy || function (url) {
|
||||
return "https://urlreq.appspot.com/req?method=GET&url=" + url;
|
||||
};
|
||||
|
||||
var fetchCalendar = function fetchCalendar() {
|
||||
return fetch(options.proxy("https://github.com/" + username)).then(function (response) {
|
||||
return response.text();
|
||||
}).then(function (body) {
|
||||
var div = document.createElement("div");
|
||||
div.innerHTML = body;
|
||||
var cal = div.querySelector(".js-yearly-contributions");
|
||||
$(".position-relative h2", cal).remove();
|
||||
cal.querySelector(".float-left.text-gray").innerHTML = options.summary_text;
|
||||
|
||||
// If 'include-fragment' with spinner img loads instead of the svg, fetchCalendar again
|
||||
if (cal.querySelector("include-fragment")) {
|
||||
setTimeout(fetchCalendar, 500);
|
||||
} else {
|
||||
// If options includes responsive, SVG element has to be manipulated to be made responsive
|
||||
if (options.responsive === true) {
|
||||
var svg = cal.querySelector("svg.js-calendar-graph-svg");
|
||||
// Get the width/height properties and use them to create the viewBox
|
||||
var width = svg.getAttribute("width");
|
||||
var height = svg.getAttribute("height");
|
||||
// Remove height property entirely
|
||||
svg.removeAttribute("height");
|
||||
// Width property should be set to 100% to fill entire container
|
||||
svg.setAttribute("width", "100%");
|
||||
// Add a viewBox property based on the former width/height
|
||||
svg.setAttribute("viewBox", "0 0 " + width + " " + height);
|
||||
}
|
||||
|
||||
if (options.global_stats !== false) {
|
||||
var parsed = parse($("svg", cal).outerHTML),
|
||||
currentStreakInfo = parsed.current_streak ? formatoid(parsed.current_streak_range[0], DATE_FORMAT2) + " – " + formatoid(parsed.current_streak_range[1], DATE_FORMAT2) : parsed.last_contributed ? "Last contributed in " + formatoid(parsed.last_contributed, DATE_FORMAT2) + "." : "Rock - Hard Place",
|
||||
longestStreakInfo = parsed.longest_streak ? formatoid(parsed.longest_streak_range[0], DATE_FORMAT2) + " – " + formatoid(parsed.longest_streak_range[1], DATE_FORMAT2) : parsed.last_contributed ? "Last contributed in " + formatoid(parsed.last_contributed, DATE_FORMAT2) + "." : "Rock - Hard Place",
|
||||
firstCol = $("<div>", {
|
||||
"class": "contrib-column contrib-column-first table-column",
|
||||
html: "<span class=\"text-muted\">Contributions in the last year</span>\n <span class=\"contrib-number\">" + parsed.last_year + " total</span>\n <span class=\"text-muted\">" + formatoid(addSubtractDate.subtract(new Date(), 1, "year"), DATE_FORMAT1) + " – " + formatoid(new Date(), DATE_FORMAT1) + "</span>"
|
||||
}),
|
||||
secondCol = $("<div>", {
|
||||
"class": "contrib-column table-column",
|
||||
html: "<span class=\"text-muted\">Longest streak</span>\n <span class=\"contrib-number\">" + parsed.longest_streak + " days</span>\n <span class=\"text-muted\">" + longestStreakInfo + "</span>"
|
||||
}),
|
||||
thirdCol = $("<div>", {
|
||||
"class": "contrib-column table-column",
|
||||
html: "<span class=\"text-muted\">Current streak</span>\n <span class=\"contrib-number\">" + parsed.current_streak + " days</span>\n <span class=\"text-muted\">" + currentStreakInfo + "</span>"
|
||||
});
|
||||
|
||||
cal.appendChild(firstCol);
|
||||
cal.appendChild(secondCol);
|
||||
cal.appendChild(thirdCol);
|
||||
}
|
||||
|
||||
container.innerHTML = cal.innerHTML;
|
||||
}
|
||||
}).catch(function (e) {
|
||||
return console.error(e);
|
||||
});
|
||||
};
|
||||
|
||||
return fetchCalendar();
|
||||
};
|
|
@ -1,182 +0,0 @@
|
|||
{
|
||||
"_from": "github-calendar",
|
||||
"_id": "github-calendar@1.3.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ABlceh7wTRLvKQK1h0srrD9FHjHeHXtsxPw8sEUOX9uq4YItlrPaLY7ftNuvC0N1w6yCjcQBV+zjIzNAD9iczg==",
|
||||
"_location": "/github-calendar",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "github-calendar",
|
||||
"name": "github-calendar",
|
||||
"escapedName": "github-calendar",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/github-calendar/-/github-calendar-1.3.1.tgz",
|
||||
"_shasum": "a746a4fc3d1cdf0dae970b1c8e6fc8b70c547264",
|
||||
"_spec": "github-calendar",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "https://ionicabizau.net"
|
||||
},
|
||||
"blah": {
|
||||
"example": [
|
||||
{
|
||||
"code": {
|
||||
"language": "html",
|
||||
"content": [
|
||||
"<!-- Include the library. -->",
|
||||
"<script",
|
||||
" src=\"https://unpkg.com/github-calendar@latest/dist/github-calendar.min.js\">",
|
||||
"</script>",
|
||||
"",
|
||||
"<!-- Optionally, include the theme (if you don't want to struggle to write the CSS) -->",
|
||||
"<link",
|
||||
" rel=\"stylesheet\"",
|
||||
" href=\"https://unpkg.com/github-calendar@latest/dist/github-calendar-responsive.css\"",
|
||||
"/>",
|
||||
"",
|
||||
"<!-- Prepare a container for your calendar. -->",
|
||||
"<div class=\"calendar\">",
|
||||
" <!-- Loading stuff -->",
|
||||
" Loading the data just for you.",
|
||||
"</div>",
|
||||
"",
|
||||
"<script>",
|
||||
" GitHubCalendar(\".calendar\", \"your-username\");",
|
||||
" // or enable responsive functionality:",
|
||||
" GitHubCalendar(\".calendar\", \"your-username\", { responsive: true });",
|
||||
"</script>"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"p": "[Here](http://codepen.io/anon/pen/aZmjvZ?editors=1000) you can see this example in action."
|
||||
}
|
||||
],
|
||||
"thanks": {
|
||||
"ul": [
|
||||
"Big thanks to [**@izuzak**](https://github.com/izuzak) for creating the [urlreq](https://github.com/izuzak/urlreq) project–the default proxy used by this library. :cake:",
|
||||
"Part of the CSS code was taken from the GitHub profile page to offer the same experience. :art:"
|
||||
]
|
||||
},
|
||||
"description": [
|
||||
{
|
||||
"p": "Everybody<sup><sup>well, haters gonna hate</sup></sup> loves GitHub and everybody loves stats. So, why not making the GitHub contributions calendar available for being embeded in your web pages? Now [you can](https://ionicabizau.github.io/github-calendar/example). :tada:"
|
||||
},
|
||||
{
|
||||
"p": "[![](http://i.imgur.com/S1h8XoB.jpg)](https://ionicabizau.github.io/github-calendar/example)"
|
||||
}
|
||||
],
|
||||
"title": "github-calendar.js",
|
||||
"related": {
|
||||
"ul": [
|
||||
"github-profile-languages",
|
||||
"github-org-members.js",
|
||||
"gh-contributions",
|
||||
"github-emojify",
|
||||
"github-stats",
|
||||
"github-labeller",
|
||||
"cli-gh-cal",
|
||||
"gh-destroy",
|
||||
"ship-release",
|
||||
"github-calendar-legend",
|
||||
"github-pr-branch-links",
|
||||
"github-emoji-form-submit",
|
||||
"gh-repeat",
|
||||
"gh-repos",
|
||||
"github-old-header",
|
||||
"gh.js",
|
||||
"ghcal",
|
||||
"sort-github-user-repos",
|
||||
"github-calendar-parser",
|
||||
"gh-notifier",
|
||||
"octimatch",
|
||||
"github-portfolio",
|
||||
"gh-polyglot",
|
||||
"cli-github",
|
||||
"github-calendar",
|
||||
"git-stats",
|
||||
"repository-downloader",
|
||||
"github-colors"
|
||||
]
|
||||
}
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/github-calendar/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Evan Palmer",
|
||||
"email": "evjpalmer@gmail.com",
|
||||
"url": "http://evanpalmer.net"
|
||||
},
|
||||
{
|
||||
"name": "Francesco Tonini",
|
||||
"email": "francescoantoniotonini@gmail.com",
|
||||
"url": "https://francescotonini.it"
|
||||
},
|
||||
{
|
||||
"name": "Miroslav Vidovic",
|
||||
"email": "miroslav-vidovic@hotmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Mike Roibu",
|
||||
"email": "mike@codingden.net"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"add-subtract-date": "^1.0.5",
|
||||
"elly": "^1.0.0",
|
||||
"formatoid": "^1.0.3",
|
||||
"github-calendar-parser": "^1.1.3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Embed your GitHub contributions calendar anywhere.",
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"scripts/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"bloggify.js",
|
||||
"bloggify.json",
|
||||
"bloggify/"
|
||||
],
|
||||
"homepage": "https://github.com/IonicaBizau/github-calendar#readme",
|
||||
"keywords": [
|
||||
"github",
|
||||
"calendar",
|
||||
"embed"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "github-calendar",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/IonicaBizau/github-calendar.git"
|
||||
},
|
||||
"scripts": {
|
||||
"release": "dist-it lib/index.js github-calendar.min.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.3.1"
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
# :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk:
|
||||
|
||||
So, you want to contribute to this project! That's awesome. However, before
|
||||
doing so, please read the following simple steps how to contribute. This will
|
||||
make the life easier and will avoid wasting time on things which are not
|
||||
requested. :sparkles:
|
||||
|
||||
## Discuss the changes before doing them
|
||||
- First of all, open an issue in the repository, using the [bug tracker][1],
|
||||
describing the contribution you would like to make, the bug you found or any
|
||||
other ideas you have. This will help us to get you started on the right
|
||||
foot.
|
||||
|
||||
- If it makes sense, add the platform and software information (e.g. operating
|
||||
system, Node.JS version etc.), screenshots (so we can see what you are
|
||||
seeing).
|
||||
|
||||
- It is recommended to wait for feedback before continuing to next steps.
|
||||
However, if the issue is clear (e.g. a typo) and the fix is simple, you can
|
||||
continue and fix it.
|
||||
|
||||
## Fixing issues
|
||||
- Fork the project in your account and create a branch with your fix:
|
||||
`some-great-feature` or `some-issue-fix`.
|
||||
|
||||
- Commit your changes in that branch, writing the code following the
|
||||
[code style][2]. If the project contains tests (generally, the `test`
|
||||
directory), you are encouraged to add a test as well. :memo:
|
||||
|
||||
- If the project contains a `package.json` or a `bower.json` file add yourself
|
||||
in the `contributors` array (or `authors` in the case of `bower.json`;
|
||||
if the array does not exist, create it):
|
||||
|
||||
```json
|
||||
{
|
||||
"contributors": [
|
||||
"Your Name <and@email.address> (http://your.website)"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Creating a pull request
|
||||
|
||||
- Open a pull request, and reference the initial issue in the pull request
|
||||
message (e.g. *fixes #<your-issue-number>*). Write a good description and
|
||||
title, so everybody will know what is fixed/improved.
|
||||
|
||||
- If it makes sense, add screenshots, gifs etc., so it is easier to see what
|
||||
is going on.
|
||||
|
||||
## Wait for feedback
|
||||
Before accepting your contributions, we will review them. You may get feedback
|
||||
about what should be fixed in your modified code. If so, just keep committing
|
||||
in your branch and the pull request will be updated automatically.
|
||||
|
||||
## Everyone is happy!
|
||||
Finally, your contributions will be merged, and everyone will be happy! :smile:
|
||||
Contributions are more than welcome!
|
||||
|
||||
Thanks! :sweat_smile:
|
||||
|
||||
|
||||
|
||||
[1]: https://github.com/IonicaBizau/node-iterate-object/issues
|
||||
|
||||
[2]: https://github.com/IonicaBizau/code-style
|
|
@ -1,15 +0,0 @@
|
|||
## Documentation
|
||||
|
||||
You can see below the API reference of this module.
|
||||
|
||||
### `iterateObject(obj, fn)`
|
||||
Iterates an object. Note the object field order may differ.
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `obj`: The input object.
|
||||
- **Function** `fn`: A function that will be called with the current value, field name and provided object.
|
||||
|
||||
#### Return
|
||||
- **Function** The `iterateObject` function.
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-19 Ionică Bizău <bizauionica@gmail.com> (http://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,193 +0,0 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
# iterate-object
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/iterate-object.svg)](https://www.npmjs.com/package/iterate-object) [![Downloads](https://img.shields.io/npm/dt/iterate-object.svg)](https://www.npmjs.com/package/iterate-object) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
> A convenient way to iterate objects.
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save iterate-object
|
||||
|
||||
# Using yarn
|
||||
yarn add iterate-object
|
||||
```
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
// Dependencies
|
||||
var IterateObject = require("iterate-object");
|
||||
|
||||
// Iterate this object
|
||||
IterateObject({
|
||||
name: "Bob"
|
||||
, age: 42
|
||||
}, function (value, name) {
|
||||
console.log(name, value);
|
||||
});
|
||||
// => "name", "Bob"
|
||||
// "age", 42
|
||||
|
||||
// Iterate an array
|
||||
IterateObject([
|
||||
1, 2, 3, 4, 5, 6, 7
|
||||
], function (value, i) {
|
||||
console.log("v[" + i + "] = " + value);
|
||||
});
|
||||
// => v[0] = 1
|
||||
// v[1] = 2
|
||||
// v[2] = 3
|
||||
// v[3] = 4
|
||||
// v[4] = 5
|
||||
// v[5] = 6
|
||||
// v[6] = 7
|
||||
|
||||
// Iterate an array
|
||||
IterateObject([
|
||||
"Alice", "Bob", "Carol", "Dave"
|
||||
], function (value, i, arr) {
|
||||
console.log("Current: " + value + (arr[i + 1] ? " Next:" + arr[i + 1] : ""));
|
||||
});
|
||||
// => Current: Alice Next:Bob
|
||||
// Current: Bob Next:Carol
|
||||
// Current: Carol Next:Dave
|
||||
// Current: Dave
|
||||
```
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `iterateObject(obj, fn)`
|
||||
Iterates an object. Note the object field order may differ.
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `obj`: The input object.
|
||||
- **Function** `fn`: A function that will be called with the current value, field name and provided object.
|
||||
|
||||
#### Return
|
||||
- **Function** The `iterateObject` function.
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||
![](https://i.imgur.com/z6OQI95.png)
|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
|
||||
- [`barbe`](https://github.com/IonicaBizau/barbe)—Like mustache, but simple, tiny and fast.
|
||||
- [`bloggify-actions`](https://github.com/Bloggify/bloggify-actions#readme) (by Bloggify)—High-level module for building the actions functionality. Core module.
|
||||
- [`bloggify-config`](https://github.com/Bloggify/bloggify-config#readme) (by Bloggify)—Helper module to create Bloggify configuration.
|
||||
- [`bloggify-flexible-router`](https://github.com/Bloggify/flexible-router#readme) (by Bloggify)—A flexible router for Bloggify apps.
|
||||
- [`bloggify-mongoose`](https://github.com/Bloggify/bloggify-mongoose#readme) (by Bloggify)—Support for Mongoose models in Bloggify.
|
||||
- [`bloggify-on-request`](https://github.com/Bloggify/on-request#readme)—Do custom stuff on request and optionally send a custom response.
|
||||
- [`bloggify-page`](https://github.com/Bloggify/bloggify-page#readme) (by Bloggify)—The Bloggify page class.
|
||||
- [`bloggify-paths`](https://github.com/IonicaBizau/bloggify-paths#readme)—Helper library for maintaining the Bloggify paths in one place.
|
||||
- [`bloggify-redirect`](https://github.com/Bloggify/redirect#readme)—A Bloggify plugin to handle the link redirects.
|
||||
- [`bloggify-sequelize`](https://github.com/Bloggify/bloggify-sequelize#readme) (by Bloggify)—Use Sequelize in Bloggify applications.
|
||||
- [`bloggify-shortcode`](https://github.com/IonicaBizau/bloggify-shortcode#readme)—Shortcode plugin for Bloggify.
|
||||
- [`bloggify-template-renderer`](https://github.com/Bloggify/template-renderer#readme) (by Bloggify)—The default template renderer for Bloggify.
|
||||
- [`bloggify-theme-renderer`](https://github.com/Bloggify/theme-renderer#readme) (by Bloggify)—The default theme renderer for Bloggify.
|
||||
- [`color-it`](https://github.com/IonicaBizau/node-color-it#readme)—Flat colors for your Node.js strings.
|
||||
- [`couleurs`](https://github.com/IonicaBizau/node-couleurs)—Add some color and styles to your Node.JS strings.
|
||||
- [`edit-json-file`](https://github.com/IonicaBizau/edit-json-file#readme)—Edit a json file with ease.
|
||||
- [`elly`](https://github.com/IonicaBizau/elly#readme)—A tiny library for creating and selecting DOM elements.
|
||||
- [`emoji-from-word`](https://github.com/IonicaBizau/emoji-from-word#readme)—Get emoji from input word.
|
||||
- [`emoji-name-map`](https://github.com/IonicaBizau/emoji-name-map#readme)—Name to unicode emoji mapping.
|
||||
- [`emoji-unicode-map`](https://github.com/IonicaBizau/emoji-unicode-map#readme)—Unicode to name emoji mapping.
|
||||
- [`emoji.css`](https://github.com/IonicaBizau/emoji.css)—Your website. Emojified. Like FontAwesome for emojis.
|
||||
- [`emojic`](https://github.com/IonicaBizau/emojic#readme)—Emoji in your Node.js command line apps.
|
||||
- [`engine-builder`](https://github.com/IonicaBizau/engine-parser) (by jillix)—Engine composition parser.
|
||||
- [`engine-flow-types`](https://github.com/jillix/engine-flow-types#readme) (by jillix)—Low level library providing Engine flow types.
|
||||
- [`engine-parser`](https://github.com/IonicaBizau/engine-parser) (by jillix)—Engine composition parser.
|
||||
- [`enny`](https://github.com/IonicaBizau/enny) (by jillix)—Generate Engine compositions from human-readable inputs.
|
||||
- [`err`](https://github.com/IonicaBizau/err#readme)—A tiny library to create custom errors in JavaScript.
|
||||
- [`error-creator`](https://github.com/Bloggify/error-creator#readme) (by Bloggify)—Create errors with dynamic parameters and i18n in mind.
|
||||
- [`gh-following`](https://github.com/IonicaBizau/gh-following#readme)—Fetches the users you follow but they don't follow you and the users that follow you but you don't.
|
||||
- [`git-stats`](https://github.com/IonicaBizau/git-stats)—Local git statistics including GitHub-like contributions calendars.
|
||||
- [`gm-tools`](https://github.com/IonicaBizau/gm-tools#readme)—Friendly tools for interacting with GraphicsMagick.
|
||||
- [`gpm`](https://github.com/IonicaBizau/gpm)—npm + git = gpm - Install NPM packages and dependencies from git repositories.
|
||||
- [`html-encoder-decoder`](https://github.com/IonicaBizau/html-encoder-decoder)—HTML Encoder / Decoder - Converts characters to their corresponding HTML Entities
|
||||
- [`lien`](https://github.com/LienJS/Lien)—An easy to use web framework for Node.js.
|
||||
- [`love-you`](https://github.com/IonicaBizau/love-you#readme)—"I love you" in different languages.
|
||||
- [`map-o`](https://github.com/IonicaBizau/node-map-o)—Array-map like function for objects.
|
||||
- [`match`](https://github.com/IonicaBizau/match.js#readme)—Simplest way to create match memory games.
|
||||
- [`mini-lightbox`](https://github.com/ionicabizau/mini-lightbox)—Minimalist image lightbox
|
||||
- [`nodeice`](https://github.com/IonicaBizau/nodeice)—Another PDF invoice generator
|
||||
- [`oargv`](https://github.com/IonicaBizau/node-oargv)—Turns an object into a bash command.
|
||||
- [`obj-flatten`](https://github.com/IonicaBizau/obj-flatten#readme)—Convert nested objects in flatten ones.
|
||||
- [`obj-unflatten`](https://github.com/IonicaBizau/obj-unflatten#readme)—Convert flatten objects in nested ones.
|
||||
- [`remove-one-element-arrays`](https://github.com/IonicaBizau/remove-one-element-arrays#readme)—Removes the one-element arrays from an object.
|
||||
- [`rucksack`](https://github.com/Bloggify/rucksack#readme) (by Bloggify)—JavaScript and CSS bundler.
|
||||
- [`scrape-it`](https://github.com/IonicaBizau/scrape-it#readme)—A Node.js scraper for humans.
|
||||
- [`scrape-it-plus`](https://github.com/rukandax/scrape-it-plus#readme) (by Rukanda Faridsi)—A Node.js scraper for humans (with extended function).
|
||||
- [`stringify-env`](https://github.com/Bloggify/stringify-env#readme) (by Bloggify)—Create files storing environment variables.
|
||||
- [`svg.connectable.js`](https://github.com/jillix/svg.connectable.js) (by jillix)—A JavaScript library for connecting SVG things.
|
||||
- [`tilda`](https://github.com/IonicaBizau/tilda)—Tiny module for building command line tools.
|
||||
- [`validate5`](https://github.com/IonicaBizau/validate5#readme)—Form validations made easy.
|
||||
- [`xml-jsonify`](https://github.com/IonicaBizau/xml-jsonify#readme)—A liberal XML to JSON converter.
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(http%3A%2F%2Fionicabizau.net)&year=2015#license-mit
|
||||
[website]: http://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
|
@ -1,35 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
// Dependencies
|
||||
var IterateObject = require("../lib");
|
||||
|
||||
// Iterate this object
|
||||
IterateObject({
|
||||
name: "Bob",
|
||||
age: 42
|
||||
}, function (value, name) {
|
||||
console.log(name, value);
|
||||
});
|
||||
// => "name", "Bob"
|
||||
// "age", 42
|
||||
|
||||
// Iterate an array
|
||||
IterateObject([1, 2, 3, 4, 5, 6, 7], function (value, i) {
|
||||
console.log("v[" + i + "] = " + value);
|
||||
});
|
||||
// => v[0] = 1
|
||||
// v[1] = 2
|
||||
// v[2] = 3
|
||||
// v[3] = 4
|
||||
// v[4] = 5
|
||||
// v[5] = 6
|
||||
// v[6] = 7
|
||||
|
||||
// Iterate an array
|
||||
IterateObject(["Alice", "Bob", "Carol", "Dave"], function (value, i, arr) {
|
||||
console.log("Current: " + value + (arr[i + 1] ? " Next:" + arr[i + 1] : ""));
|
||||
});
|
||||
// => Current: Alice Next:Bob
|
||||
// Current: Bob Next:Carol
|
||||
// Current: Carol Next:Dave
|
||||
// Current: Dave
|
|
@ -1,35 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
/**
|
||||
* iterateObject
|
||||
* Iterates an object. Note the object field order may differ.
|
||||
*
|
||||
* @name iterateObject
|
||||
* @function
|
||||
* @param {Object} obj The input object.
|
||||
* @param {Function} fn A function that will be called with the current value, field name and provided object.
|
||||
* @return {Function} The `iterateObject` function.
|
||||
*/
|
||||
function iterateObject(obj, fn) {
|
||||
var i = 0,
|
||||
keys = [];
|
||||
|
||||
if (Array.isArray(obj)) {
|
||||
for (; i < obj.length; ++i) {
|
||||
if (fn(obj[i], i, obj) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ((typeof obj === "undefined" ? "undefined" : _typeof(obj)) === "object" && obj !== null) {
|
||||
keys = Object.keys(obj);
|
||||
for (; i < keys.length; ++i) {
|
||||
if (fn(obj[keys[i]], keys[i], obj) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = iterateObject;
|
|
@ -1,55 +0,0 @@
|
|||
{
|
||||
"_from": "iterate-object@^1.3.2",
|
||||
"_id": "iterate-object@1.3.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-DximWbkke36cnrSfNJv6bgcB2QOMV9PRD2FiowwzCoMsh8RupFLdbNIzWe+cVDWT+NIMNJgGlB1dGxP6kpzGtA==",
|
||||
"_location": "/iterate-object",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "iterate-object@^1.3.2",
|
||||
"name": "iterate-object",
|
||||
"escapedName": "iterate-object",
|
||||
"rawSpec": "^1.3.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.3.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/elly"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/iterate-object/-/iterate-object-1.3.3.tgz",
|
||||
"_shasum": "c58e60f7f0caefa2d382027a484b215988a7a296",
|
||||
"_spec": "iterate-object@^1.3.2",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/elly",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "http://ionicabizau.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/node-iterate-object/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "A convenient way to iterate objects.",
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"homepage": "https://github.com/IonicaBizau/node-iterate-object",
|
||||
"keywords": [
|
||||
"iterate",
|
||||
"object"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "iterate-object",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/IonicaBizau/node-iterate-object.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.3.3"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
|
@ -1,101 +0,0 @@
|
|||
# months [![NPM version](https://img.shields.io/npm/v/months.svg?style=flat)](https://www.npmjs.com/package/months) [![NPM monthly downloads](https://img.shields.io/npm/dm/months.svg?style=flat)](https://npmjs.org/package/months) [![NPM total downloads](https://img.shields.io/npm/dt/months.svg?style=flat)](https://npmjs.org/package/months) [![Linux Build Status](https://img.shields.io/travis/datetime/months.svg?style=flat&label=Travis)](https://travis-ci.org/datetime/months)
|
||||
|
||||
> Months of the year.
|
||||
|
||||
- [Install](#install)
|
||||
- [Usage](#usage)
|
||||
- [About](#about)
|
||||
|
||||
_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save months
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var months = require('months');
|
||||
|
||||
console.log(months);
|
||||
//=> ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
||||
|
||||
console.log(months.abbr);
|
||||
//=> ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
|
||||
console.log(months.it);
|
||||
//=> [ 'Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre' ]
|
||||
|
||||
console.log(months.abbr.it);
|
||||
//=> [ 'Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic' ]
|
||||
|
||||
console.log(months.de);
|
||||
//=> [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']
|
||||
|
||||
console.log(months.abbr.de);
|
||||
//=> [ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ]
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
### Related projects
|
||||
|
||||
* [days](https://www.npmjs.com/package/days): Days of the week. | [homepage](https://github.com/jonschlinkert/days "Days of the week.")
|
||||
* [nanoseconds](https://www.npmjs.com/package/nanoseconds): Convert the process.hrtime array to a single nanoseconds value. | [homepage](https://github.com/jonschlinkert/nanoseconds "Convert the process.hrtime array to a single nanoseconds value.")
|
||||
* [o-clock](https://www.npmjs.com/package/o-clock): Simple javascript utility for displaying the time in 12-hour clock format. | [homepage](https://github.com/jonschlinkert/o-clock "Simple javascript utility for displaying the time in 12-hour clock format.")
|
||||
* [pretty-time](https://www.npmjs.com/package/pretty-time): Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds. | [homepage](https://github.com/jonschlinkert/pretty-time "Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.")
|
||||
* [seconds](https://www.npmjs.com/package/seconds): Get the number of seconds for a minute, hour, day and week. | [homepage](https://github.com/jonschlinkert/seconds "Get the number of seconds for a minute, hour, day and week.")
|
||||
* [time-stamp](https://www.npmjs.com/package/time-stamp): Get a formatted timestamp. | [homepage](https://github.com/jonschlinkert/time-stamp "Get a formatted timestamp.")
|
||||
* [week](https://www.npmjs.com/package/week): Get the current week number. | [homepage](https://github.com/datetime/week "Get the current week number.")
|
||||
* [year](https://www.npmjs.com/package/year): Simple utility to get the current year with 2 or 4 digits. | [homepage](https://github.com/jonschlinkert/year "Simple utility to get the current year with 2 or 4 digits.")
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 12 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 6 | [doowb](https://github.com/doowb) |
|
||||
| 4 | [mihailgaberov](https://github.com/mihailgaberov) |
|
||||
| 3 | [Rawnly](https://github.com/Rawnly) |
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 10, 2017._
|
|
@ -1,18 +0,0 @@
|
|||
/*!
|
||||
* months <https://github.com/datetime/months>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
// English Translation
|
||||
module.exports = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
||||
module.exports.abbr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
|
||||
// Italian Translation
|
||||
module.exports.it = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'];
|
||||
module.exports.abbr.it = ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic'];
|
||||
|
||||
// German Translation
|
||||
module.exports.de = [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'];
|
||||
module.exports.abbr.de = [ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ];
|
|
@ -1,106 +0,0 @@
|
|||
{
|
||||
"_from": "months@^1.0.0",
|
||||
"_id": "months@1.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-zFM7hUpziSYGk2DNObYGWgHdRRxAOgjl8CC1Rbl50p/q0rGDsREfk0nbxxmSIquVi/lEAuUY8nwbwkZ8biNCOQ==",
|
||||
"_location": "/months",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "months@^1.0.0",
|
||||
"name": "months",
|
||||
"escapedName": "months",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/formatoid"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/months/-/months-1.2.0.tgz",
|
||||
"_shasum": "beef54873960334abe0b03f6b38db8adb44a13ac",
|
||||
"_spec": "months@^1.0.0",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/formatoid",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/datetime/months/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Brian Woodward",
|
||||
"url": "https://twitter.com/doowb"
|
||||
},
|
||||
{
|
||||
"name": "Federico Vitale",
|
||||
"url": "https://rawnly.com"
|
||||
},
|
||||
{
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "http://twitter.com/jonschlinkert"
|
||||
},
|
||||
{
|
||||
"name": "Mihail Gaberov",
|
||||
"url": "http://mihail-gaberov.eu"
|
||||
}
|
||||
],
|
||||
"deprecated": false,
|
||||
"description": "Months of the year.",
|
||||
"devDependencies": {
|
||||
"gulp-format-md": "^1.0.0",
|
||||
"mocha": "^3.4.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/datetime/months",
|
||||
"keywords": [
|
||||
"calendar",
|
||||
"date",
|
||||
"month",
|
||||
"months"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "months",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/datetime/months.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"verb": {
|
||||
"toc": true,
|
||||
"related": {
|
||||
"list": [
|
||||
"days",
|
||||
"nanoseconds",
|
||||
"o-clock",
|
||||
"pretty-time",
|
||||
"seconds",
|
||||
"time-stamp",
|
||||
"week",
|
||||
"year"
|
||||
]
|
||||
},
|
||||
"layout": "default",
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
}
|
||||
},
|
||||
"version": "1.2.0"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-19 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,148 +0,0 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
# parse-it
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/parse-it.svg)](https://www.npmjs.com/package/parse-it) [![Downloads](https://img.shields.io/npm/dt/parse-it.svg)](https://www.npmjs.com/package/parse-it) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
> Configurable string templating, without separators.
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save parse-it
|
||||
|
||||
# Using yarn
|
||||
yarn add parse-it
|
||||
```
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
const parseIt = require("parse-it");
|
||||
|
||||
// Replace strings
|
||||
console.log(parseIt("Hello WORLD!", { WORLD: "Mars" }));
|
||||
// => Hello Mars!
|
||||
|
||||
// Use functions
|
||||
console.log(parseIt("Random number: random", { random: () => Math.random() }));
|
||||
// => Random number: 0.21168493130244315
|
||||
|
||||
// Using as class
|
||||
var Parser = parseIt.Parser;
|
||||
|
||||
// Display a date
|
||||
var p = new Parser({
|
||||
d: function (d) { return d.getDate() }
|
||||
, M: function (d) { return d.getMonth() }
|
||||
, YYYY: function (d) { return d.getFullYear() }
|
||||
});
|
||||
|
||||
console.log(p.run("d/M/YYYY", [new Date(1989, 11, 20)]));
|
||||
// => 20/11/1989
|
||||
```
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `ParseIt(obj)`
|
||||
The `ParseIt` class. It can be used to use the same data object but with different formats/arguments.
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `obj`: An object containing the fields to replace.
|
||||
|
||||
### `parseIt(format, args)`
|
||||
run
|
||||
Replaces the fields in the format string with data coming from the data object.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String** `format`: The format input.
|
||||
- **Array** `args`: An array of arguments to be passed to the replace function (stored in the `obj` object).
|
||||
|
||||
#### Return
|
||||
- **String** The result as string.
|
||||
|
||||
### `parseIt(format, obj, args)`
|
||||
A wrapper around the `ParseIt` class. The `ParseIt` constructor is accessible using `parseIt.Parser`.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String** `format`: The format input.
|
||||
- **Object** `obj`: An object containing the fields to replace.
|
||||
- **Array** `args`: An array of arguments to be passed to the replace function (stored in the `obj` object).
|
||||
|
||||
#### Return
|
||||
- **String** The result as string.
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||
![](https://i.imgur.com/z6OQI95.png)
|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
|
||||
- [`formatoid`](https://github.com/IonicaBizau/formatoid#readme)—Tiny and fast module for formatting date objects.
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(https%3A%2F%2Fionicabizau.net)&year=2015#license-mit
|
||||
[website]: https://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
|
@ -1,85 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var regexEscape = require("regex-escape");
|
||||
|
||||
var ParseIt = function () {
|
||||
/**
|
||||
* ParseIt
|
||||
* The `ParseIt` class. It can be used to use the same data object but with different formats/arguments.
|
||||
*
|
||||
* @name ParseIt
|
||||
* @function
|
||||
* @param {Object} obj An object containing the fields to replace.
|
||||
*/
|
||||
function ParseIt(obj) {
|
||||
_classCallCheck(this, ParseIt);
|
||||
|
||||
this.obj = obj || {};
|
||||
this.re = new RegExp("^(" + Object.keys(obj).map(regexEscape).join("|") + ")");
|
||||
}
|
||||
|
||||
/**
|
||||
* run
|
||||
* Replaces the fields in the format string with data coming from the data object.
|
||||
*
|
||||
*
|
||||
* @name parseIt
|
||||
* @function
|
||||
* @param {String} format The format input.
|
||||
* @param {Array} args An array of arguments to be passed to the replace function (stored in the `obj` object).
|
||||
* @return {String} The result as string.
|
||||
*/
|
||||
|
||||
|
||||
_createClass(ParseIt, [{
|
||||
key: "run",
|
||||
value: function run(format, args) {
|
||||
var result = "";
|
||||
args = args || [];
|
||||
do {
|
||||
var arr = format.match(this.re),
|
||||
field = arr && arr[1],
|
||||
c = field || format.charAt(0);
|
||||
|
||||
if (field) {
|
||||
var value = this.obj[field];
|
||||
if (typeof value === "function") {
|
||||
value = value.apply(this, args);
|
||||
}
|
||||
result += value;
|
||||
} else {
|
||||
result += c;
|
||||
}
|
||||
format = format.substring(c.length);
|
||||
} while (format);
|
||||
return result;
|
||||
}
|
||||
}]);
|
||||
|
||||
return ParseIt;
|
||||
}();
|
||||
|
||||
/**
|
||||
* parseIt
|
||||
* A wrapper around the `ParseIt` class. The `ParseIt` constructor is accessible using `parseIt.Parser`.
|
||||
*
|
||||
* @name parseIt
|
||||
* @function
|
||||
* @param {String} format The format input.
|
||||
* @param {Object} obj An object containing the fields to replace.
|
||||
* @param {Array} args An array of arguments to be passed to the replace function (stored in the `obj` object).
|
||||
* @return {String} The result as string.
|
||||
*/
|
||||
|
||||
|
||||
function parseIt(format, obj, args) {
|
||||
return new ParseIt(obj).run(format, args);
|
||||
}
|
||||
|
||||
parseIt.Parser = ParseIt;
|
||||
|
||||
module.exports = parseIt;
|
|
@ -1,71 +0,0 @@
|
|||
{
|
||||
"_from": "parse-it@^1.0.0",
|
||||
"_id": "parse-it@1.0.9",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-8KW9XwW5+DFsvkkSXLZw7AGormnQ+/unnqmTPq7uoiAJNaeLo0T78zT/Ootc0HrdEgVvxM4+mOCRLKJOVtkogQ==",
|
||||
"_location": "/parse-it",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "parse-it@^1.0.0",
|
||||
"name": "parse-it",
|
||||
"escapedName": "parse-it",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/formatoid"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/parse-it/-/parse-it-1.0.9.tgz",
|
||||
"_shasum": "09c9f52734de2cba309d0e083de305c912f294f3",
|
||||
"_spec": "parse-it@^1.0.0",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/formatoid",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "https://ionicabizau.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/parse-it/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"regex-escape": "^3.4.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Configurable string templating, without separators.",
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"scripts/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"bloggify.js",
|
||||
"bloggify.json",
|
||||
"bloggify/"
|
||||
],
|
||||
"homepage": "https://github.com/IonicaBizau/parse-it#readme",
|
||||
"keywords": [
|
||||
"parser",
|
||||
"templating",
|
||||
"string"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "parse-it",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/IonicaBizau/parse-it.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"version": "1.0.9"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,48 +0,0 @@
|
|||
# Primer Base
|
||||
|
||||
[![npm version](https://img.shields.io/npm/v/primer-base.svg)](https://www.npmjs.org/package/primer-base)
|
||||
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)
|
||||
|
||||
> GitHub's CSS to reset the browsers default styles. Built on top of normalize.css
|
||||
|
||||
This repository is a module of the full [primer][primer] repository. And is built off of [normalize.css](https://github.com/necolas/normalize.css/)
|
||||
|
||||
## Install
|
||||
|
||||
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-base` with this command.
|
||||
|
||||
```
|
||||
$ npm install --save primer-base
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The source files included are written in [Sass][sass] (`scss`) You can simply point your sass `include-path` at your `node_modules` directory and import it like this.
|
||||
|
||||
```scss
|
||||
@import "primer-base/index.scss";
|
||||
```
|
||||
|
||||
You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._
|
||||
|
||||
## Build
|
||||
|
||||
For a compiled **css** version of this module, a npm script is included that will output a css version to `build/build.css` The built css file is also included in the npm package.
|
||||
|
||||
```
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
You can read more about base in the [docs][docs].
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) © [GitHub](https://github.com/)
|
||||
|
||||
[primer]: https://github.com/primer/primer
|
||||
[docs]: http://primer.github.io/
|
||||
[npm]: https://www.npmjs.com/
|
||||
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
|
||||
[sass]: http://sass-lang.com/
|
|
@ -1 +0,0 @@
|
|||
/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}template,[hidden]{display:none !important}a{background-color:transparent}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}button,input,select,textarea{font:inherit;margin:0}optgroup{font-weight:bold}button,input{overflow:visible}button,select{text-transform:none}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:0.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}*{box-sizing:border-box}input,select,textarea,button{font-family:inherit;font-size:inherit;line-height:inherit}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.5;color:#24292e;background-color:#fff}a{color:#0366d6;text-decoration:none}a:hover{text-decoration:underline}b,strong{font-weight:600}hr,.rule{height:0;margin:15px 0;overflow:hidden;background:transparent;border:0;border-bottom:1px solid #dfe2e5}hr::before,.rule::before{display:table;content:""}hr::after,.rule::after{display:table;clear:both;content:""}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}button{cursor:pointer;border-radius:0}[hidden][hidden]{display:none !important}details summary{cursor:pointer}details:not([open])>*:not(summary){display:none !important}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:0}h1{font-size:32px;font-weight:600}h2{font-size:24px;font-weight:600}h3{font-size:20px;font-weight:600}h4{font-size:16px;font-weight:600}h5{font-size:14px;font-weight:600}h6{font-size:12px;font-weight:600}p{margin-top:0;margin-bottom:10px}small{font-size:90%}blockquote{margin:0}ul,ol{padding-left:0;margin-top:0;margin-bottom:0}ol ol,ul ol{list-style-type:lower-roman}ul ul ol,ul ol ol,ol ul ol,ol ol ol{list-style-type:lower-alpha}dd{margin-left:0}tt,code{font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px}pre{margin-top:0;margin-bottom:0;font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px}.octicon{vertical-align:text-bottom}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,5 +0,0 @@
|
|||
@import "primer-support/index.scss";
|
||||
|
||||
@import "./lib/normalize.scss";
|
||||
@import "./lib/base.scss";
|
||||
@import "./lib/typography-base.scss";
|
|
@ -1,84 +0,0 @@
|
|||
// stylelint-disable selector-max-type
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
input,
|
||||
select,
|
||||
textarea,
|
||||
button {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: $body-font;
|
||||
font-size: $body-font-size;
|
||||
line-height: $body-line-height;
|
||||
color: $text-gray-dark;
|
||||
background-color: $bg-white;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $text-blue;
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: $font-weight-bold;
|
||||
}
|
||||
|
||||
// Horizontal lines
|
||||
//
|
||||
// TODO-MDO: Remove `.rule` from everywhere and replace with `<hr>`s
|
||||
hr,
|
||||
.rule {
|
||||
height: 0;
|
||||
margin: 15px 0;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-bottom: 1px solid lighten($gray-300, 5%);
|
||||
@include clearfix();
|
||||
}
|
||||
|
||||
//
|
||||
// Remove most spacing between table cells.
|
||||
//
|
||||
|
||||
table {
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
// Remove border radius added by Chroma macOS
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
// increase the selector specificity for [hidden]
|
||||
// so that it always overrides utility classes (.d-block, etc.)
|
||||
[hidden][hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
details {
|
||||
summary { cursor: pointer; }
|
||||
|
||||
&:not([open]) {
|
||||
// Set details content hidden by default for browsers that don't do this
|
||||
> *:not(summary) { display: none !important; }
|
||||
}
|
||||
}
|
|
@ -1,421 +0,0 @@
|
|||
// stylelint-disable
|
||||
/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */
|
||||
|
||||
/**
|
||||
* 1. Change the default font family in all browsers (opinionated).
|
||||
* 2. Prevent adjustments of font size after orientation changes in IE and iOS.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the margin in all browsers (opinionated).
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
* 1. Add the correct display in Edge, IE, and Firefox.
|
||||
* 2. Add the correct display in IE.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details, /* 1 */
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
main, /* 2 */
|
||||
menu,
|
||||
nav,
|
||||
section { /* 1 */
|
||||
display: block;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in iOS 4-7.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10-.
|
||||
* 1. Add the correct display in IE.
|
||||
*/
|
||||
|
||||
template, /* 1 */
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the gray background on active links in IE 10.
|
||||
*/
|
||||
|
||||
a {
|
||||
background-color: transparent; /* 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the outline on focused links when they are also active or hovered
|
||||
* in all browsers (opinionated).
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline-width: 0;
|
||||
}
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Remove the bottom border in Firefox 39-.
|
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: none; /* 1 */
|
||||
text-decoration: underline; /* 2 */
|
||||
text-decoration: underline dotted; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font style in Android 4.3-.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the font size and margin on `h1` elements within `section` and
|
||||
* `article` contexts in Chrome, Firefox, and Safari.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct background and color in IE 9-.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background-color: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||
* all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the border on images inside links in IE 10-.
|
||||
*/
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the overflow in IE.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct margin in IE 8.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in Firefox.
|
||||
* 2. Show the overflow in Edge and IE.
|
||||
*/
|
||||
|
||||
hr {
|
||||
box-sizing: content-box; /* 1 */
|
||||
height: 0; /* 1 */
|
||||
overflow: visible; /* 2 */
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Change font properties to `inherit` in all browsers (opinionated).
|
||||
* 2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font: inherit; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the font weight unset by the previous rule.
|
||||
*/
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the overflow in IE.
|
||||
* 1. Show the overflow in Edge.
|
||||
*/
|
||||
|
||||
button,
|
||||
input { /* 1 */
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||
* 1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select { /* 1 */
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
|
||||
* controls in Android 4.
|
||||
* 2. Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
html [type="button"], /* 1 */
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
[type="button"]::-moz-focus-inner,
|
||||
[type="reset"]::-moz-focus-inner,
|
||||
[type="submit"]::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
|
||||
button:-moz-focusring,
|
||||
[type="button"]:-moz-focusring,
|
||||
[type="reset"]:-moz-focusring,
|
||||
[type="submit"]:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the border, margin, and padding in all browsers (opinionated).
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the text wrapping in Edge and IE.
|
||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||
* 3. Remove the padding so developers are not caught out when they zero out
|
||||
* `fieldset` elements in all browsers.
|
||||
*/
|
||||
|
||||
legend {
|
||||
box-sizing: border-box; /* 1 */
|
||||
color: inherit; /* 2 */
|
||||
display: table; /* 1 */
|
||||
max-width: 100%; /* 1 */
|
||||
padding: 0; /* 3 */
|
||||
white-space: normal; /* 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the default vertical scrollbar in IE.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in IE 10-.
|
||||
* 2. Remove the padding in IE 10-.
|
||||
*/
|
||||
|
||||
[type="checkbox"],
|
||||
[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||
*/
|
||||
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the odd appearance in Chrome and Safari.
|
||||
* 2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner padding and cancel buttons in Chrome and Safari on OS X.
|
||||
*/
|
||||
|
||||
[type="search"]::-webkit-search-cancel-button,
|
||||
[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the text style of placeholders in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
::-webkit-input-placeholder {
|
||||
color: inherit;
|
||||
opacity: 0.54;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||
* 2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
// Headings
|
||||
// --------------------------------------------------
|
||||
// stylelint-disable selector-max-type
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
h1 { @include h1; }
|
||||
h2 { @include h2; }
|
||||
h3 { @include h3; }
|
||||
h4 { @include h4; }
|
||||
h5 { @include h5; }
|
||||
h6 { @include h6; }
|
||||
|
||||
// Body text
|
||||
// --------------------------------------------------
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
// Lists
|
||||
// --------------------------------------------------
|
||||
|
||||
ul,
|
||||
ol {
|
||||
padding-left: 0;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
ol ol,
|
||||
ul ol {
|
||||
list-style-type: lower-roman;
|
||||
}
|
||||
|
||||
ul ul ol,
|
||||
ul ol ol,
|
||||
ol ul ol,
|
||||
ol ol ol {
|
||||
list-style-type: lower-alpha;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
// Code
|
||||
// --------------------------------------------------
|
||||
|
||||
tt,
|
||||
code {
|
||||
font-family: $mono-font;
|
||||
font-size: $font-size-small;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
font-family: $mono-font;
|
||||
font-size: $font-size-small;
|
||||
}
|
||||
|
||||
// Octicons
|
||||
// --------------------------------------------------
|
||||
|
||||
// Move this over here as a temporary override to the octicons source repo
|
||||
// instead of updating that upstream.
|
||||
.octicon {
|
||||
vertical-align: text-bottom;
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
{
|
||||
"_from": "primer-base@1.9.2",
|
||||
"_id": "primer-base@1.9.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-KgZP0cGq0rdgyK5ozw7UbyqG52o0sbzAfRP3iEeoRhDwCJ3X0XaHeCINty7QhcIzWCccXkdamMe/P6HBwWM12g==",
|
||||
"_location": "/primer-base",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "primer-base@1.9.2",
|
||||
"name": "primer-base",
|
||||
"escapedName": "primer-base",
|
||||
"rawSpec": "1.9.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.9.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/primer-core"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/primer-base/-/primer-base-1.9.2.tgz",
|
||||
"_shasum": "3fa7fa362a39df8f0700f9169ffe58761134e451",
|
||||
"_spec": "primer-base@1.9.2",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/primer-core",
|
||||
"author": {
|
||||
"name": "GitHub, Inc."
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"primer-support": "4.7.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "CSS to reset the browsers default styles",
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"homepage": "http://primer.github.io/",
|
||||
"keywords": [
|
||||
"primer",
|
||||
"css",
|
||||
"github",
|
||||
"design-system",
|
||||
"base",
|
||||
"reset",
|
||||
"normalize"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "primer-base",
|
||||
"primer": {
|
||||
"category": "core",
|
||||
"module_type": "support",
|
||||
"class_whitelist": [
|
||||
"octicon",
|
||||
"rule"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/primer/primer/tree/master/modules/primer-base"
|
||||
},
|
||||
"sass": "index.scss",
|
||||
"scripts": {
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"lint": "../../script/lint-scss",
|
||||
"postpublish": "../../script/notify success",
|
||||
"prepare": "npm run build",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"test": "../../script/npm-run-all build lint"
|
||||
},
|
||||
"style": "build/build.css",
|
||||
"version": "1.9.2"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,598 +0,0 @@
|
|||
# Primer box
|
||||
|
||||
[![npm version](https://img.shields.io/npm/v/primer-box.svg)](https://www.npmjs.org/package/primer-box)
|
||||
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)
|
||||
|
||||
> Box is a module for creating rounded-corner boxes with a white background and gray borders. Box has optional element styles for headers, lists, and footers.
|
||||
|
||||
This repository is a module of the full [primer][primer] repository.
|
||||
|
||||
## Install
|
||||
|
||||
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-box` with this command.
|
||||
|
||||
```
|
||||
$ npm install --save primer-box
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The source files included are written in [Sass][sass] (`scss`) You can simply point your sass `include-path` at your `node_modules` directory and import it like this.
|
||||
|
||||
```scss
|
||||
@import "primer-box/index.scss";
|
||||
```
|
||||
|
||||
You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._
|
||||
|
||||
## Build
|
||||
|
||||
For a compiled **css** version of this module, a npm script is included that will output a css version to `build/build.css` The built css file is also included in the npm package.
|
||||
|
||||
```
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
<!-- %docs
|
||||
title: Box
|
||||
path: components/box
|
||||
status_issue: https://github.com/github/design-systems/issues/198
|
||||
status: Stable
|
||||
-->
|
||||
|
||||
The `.Box` component can be used for something as simple as a rounded corner box, or more complex lists and forms. It includes optional modifiers for padding density and color themes.
|
||||
|
||||
{:toc}
|
||||
|
||||
## Box
|
||||
|
||||
A `.Box` is a container with a a white background, a light gray border, and rounded corners. By default there are no additional styles such as padding, these can be added as needed with utility classes. Other styles and layouts can be achieved with box elements and modifiers shown in the documentation below.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
This is a box.
|
||||
</div>
|
||||
```
|
||||
|
||||
## Box elements
|
||||
Box elements include `Box-header`, `Box-body`, and `Box-footer`. These elements include borders and consistent padding. Optionally, you can include use `Box-title` which applies a bold font-weight the heading.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-header">
|
||||
<h3 class="Box-title">
|
||||
Box title
|
||||
</h3>
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
<div class="Box-footer">
|
||||
Box footer
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Box row
|
||||
|
||||
Use `Box-row` to add rows with borders and maintain the same padding. Box rows have a lighter border to give contrast between the header and footer.
|
||||
|
||||
**Note:** Box rows have some reliance on markup structure in order to target the first and last rows, therefore using an unordered list is recommended. See [box row markup structure](#box-row-markup-structure) for more information.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<ul>
|
||||
<li class="Box-row">
|
||||
Box row one
|
||||
</li>
|
||||
<li class="Box-row">
|
||||
Box row two
|
||||
</li>
|
||||
<li class="Box-row">
|
||||
Box row three
|
||||
</li>
|
||||
<li class="Box-row">
|
||||
Box row four
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
```
|
||||
|
||||
|
||||
Rows can be used with or without `Box-header`, `Box-footer`, or `Box-body`.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-header">
|
||||
Box header
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
<strong>Box body</strong>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="Box-row">
|
||||
Box row one
|
||||
</li>
|
||||
<li class="Box-row">
|
||||
Box row two
|
||||
</li>
|
||||
<li class="Box-row">
|
||||
Box row three
|
||||
</li>
|
||||
<li class="Box-row">
|
||||
Box row four
|
||||
</li>
|
||||
</ul>
|
||||
<div class="Box-footer">
|
||||
Box footer
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Box row markup structure
|
||||
Box rows have some reliance on markup structure in order to target the first and last rows. Box rows are given a top border that is lighter in color than other box elements so the first row is targeted to apply a darker border color. An inner border-radius is applied to the first and last rows that that row corners don't poke outside the `Box`, this can be particularly noticeable when using a highlight on box rows.
|
||||
|
||||
Using an unordered list is recommended in order to target the first and last rows, however, if you need to use a `<div>` for your rows, you may want to place your rows inside a parent `<div>` so that the first and last rows are styled appropriately.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-header">
|
||||
Box header
|
||||
</div>
|
||||
<!-- This wrapping div ensures the first and last rows can be targeted for styling. -->
|
||||
<div>
|
||||
<div class="Box-row">Box row using a div</div>
|
||||
<div class="Box-row">Box row using a div</div>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Box padding density
|
||||
You can changed the padding density of the box component.
|
||||
|
||||
Use `Box--condensed` to apply a more condensed line-height and reduce the padding on the Y axis.
|
||||
|
||||
```html
|
||||
<div class="Box Box--condensed">
|
||||
<div class="Box-header">
|
||||
<h3 class="Box-title">
|
||||
Box title
|
||||
</h3>
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
<ul>
|
||||
<li class="Box-row">
|
||||
Box row one
|
||||
</li>
|
||||
<li class="Box-row">
|
||||
Box row two
|
||||
</li>
|
||||
</ul>
|
||||
<div class="Box-footer">
|
||||
Box footer
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
Use `Box--spacious` to increase padding and increase the title font size.
|
||||
|
||||
You may want to increase the overall font size to work with the larger padding, in this example the default body font size is increased to 16px using the `f4` typography utility.
|
||||
|
||||
```html
|
||||
<div class="Box Box--spacious f4">
|
||||
<div class="Box-header">
|
||||
<h3 class="Box-title">
|
||||
Box title
|
||||
</h3>
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
<ul>
|
||||
<li class="Box-row">
|
||||
Box row one
|
||||
</li>
|
||||
<li class="Box-row">
|
||||
Box row two
|
||||
</li>
|
||||
</ul>
|
||||
<div class="Box-footer">
|
||||
Box footer
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Blue box theme
|
||||
Use `Box--blue` to style the box borders and box header in blue.
|
||||
|
||||
```html
|
||||
<div class="Box Box--blue">
|
||||
<div class="Box-header">
|
||||
Box header
|
||||
</div>
|
||||
<ul>
|
||||
<li class="Box-row">
|
||||
Box row one
|
||||
</li>
|
||||
<li class="Box-row">
|
||||
Box row two
|
||||
</li>
|
||||
</ul>
|
||||
<div class="Box-footer">
|
||||
Box footer
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Blue box header theme
|
||||
|
||||
Use `Box-header--blue` to add to change the header border and background to blue.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-header Box-header--blue">
|
||||
<h3 class="Box-title">Box with blue header</h3>
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Box danger theme
|
||||
|
||||
Use `Box--danger` to apply a red border to the outside of the box. This theme is helpful for communicating destructive actions.
|
||||
|
||||
**Note:** `Box-danger` only works with either `Box-row`'s or `Box-body`.
|
||||
|
||||
```html
|
||||
<div class="Box Box--danger">
|
||||
<div class="Box-row">
|
||||
Row one
|
||||
</div>
|
||||
<div class="Box-row">
|
||||
Row two
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
`Box-danger` is often paired with a red heading. See the [subhead](./subhead) docs for more information.
|
||||
|
||||
```html
|
||||
<div class="Subhead border-bottom-0">
|
||||
<h2 class="Subhead-heading Subhead-heading--danger">Danger zone</h2>
|
||||
</div>
|
||||
|
||||
<div class="Box Box--danger">
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Row themes
|
||||
You can change the background color for individual rows, or change the color on hover or navigation focus.
|
||||
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-row Box-row--gray">
|
||||
.Box-row--gray
|
||||
</div>
|
||||
<div class="Box-row Box-row--hover-gray">
|
||||
.Box-row--hover-gray
|
||||
</div>
|
||||
<div class="Box-row Box-row--yellow">
|
||||
.Box-row--yellow
|
||||
</div>
|
||||
<div class="Box-row Box-row--hover-blue">
|
||||
.Box-row--hover-blue
|
||||
</div>
|
||||
<div class="Box-row Box-row--blue">
|
||||
.Box-row--blue
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
Use `Box-row--focus-gray` or `Box-row--focus-blue` when using along-side `navigation-focus` if you want to highlight rows when using keyboard commands.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-row Box-row--focus-gray navigation-focus">
|
||||
.Box-row--focus-gray and .navigation-focus
|
||||
</div>
|
||||
<div class="Box-row Box-row--focus-gray">
|
||||
.Box-row--focus-gray
|
||||
</div>
|
||||
<div class="Box-row Box-row--focus-blue navigation-focus">
|
||||
.Box-row--focus-blue and .navigation-focus
|
||||
</div>
|
||||
<div class="Box-row Box-row--focus-blue">
|
||||
.Box-row--focus-blue
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Box row unread
|
||||
Use `.Box-row-unread` to apply a blue vertical line highlight for indicating a row contains unread items.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-row">
|
||||
Box row
|
||||
</div>
|
||||
<div class="Box-row Box-row--unread">
|
||||
Box row unread
|
||||
</div>
|
||||
<div class="Box-row">
|
||||
Box row
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Box row link
|
||||
Use .`Box-row-link` when you want a link to appear dark gray and blue on hover on desktop, and remain a blue link on mobile. This is useful to indicate links on mobile without having hover styles.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-row">
|
||||
<a class="Box-row-link" href="#box-row-link">Box row link</a>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Dashed border
|
||||
Use the `border-dashed` utility to apply a dashed border to a box.
|
||||
|
||||
```html
|
||||
<div class="Box border-dashed p-2">
|
||||
A box with a dashed border
|
||||
</div>
|
||||
```
|
||||
|
||||
## Boxes with flash alerts
|
||||
Use `flash-full` for flash alert inside a box to remove the rounded corners. Place the flash alert above the `Box-body` and underneath the `Box-header`.
|
||||
|
||||
Flash alerts come in three different colors and can be used with icons and buttons, see the [alert documentation](./alerts) for more information.
|
||||
|
||||
```erb
|
||||
<div class="Box">
|
||||
<div class="Box-header">
|
||||
Box header
|
||||
</div>
|
||||
<div class="flash flash-full">
|
||||
<button class="flash-close js-flash-close"><%= octicon "x" %></button>
|
||||
Flash message with close button.
|
||||
</div>
|
||||
<div class="flash flash-full flash-success">
|
||||
<%= octicon("check") %> Flash success with an icon.
|
||||
</div>
|
||||
<div class="flash flash-full flash-warn">
|
||||
<%= octicon("alert") %> Flash warning with an icon.
|
||||
</div>
|
||||
<div class="flash flash-full flash-error">
|
||||
Flash error inside a Box.
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Boxes with icons
|
||||
Use `Box-btn-octicon` with `btn-octicon` when you want the icon to maintain the same padding as other box elements. This selector offsets margin to ensure it lines up on the left and right sides of the box so you may need to add padding neighboring elements.
|
||||
|
||||
```erb
|
||||
<div class="Box">
|
||||
<div class="Box-body">
|
||||
<span class="pr-2">Box body</span>
|
||||
<button href="#" class="Box-btn-octicon btn-octicon"><%= octicon "pencil" %></button>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
It's common to want to float icons to the far left or right and stop the `Box-title`from wrapping underneath. To do this you'll need to create a media object with utilities. Add `clearfix` to the surrounding div (this could be the header, body, or rows), add `overflow-hidden` to the title (or other text element), and float the icons as desired.
|
||||
|
||||
```erb
|
||||
<div class="Box">
|
||||
<div class="Box-header clearfix">
|
||||
<button href="#" class="Box-btn-octicon btn-octicon float-right"><%= octicon "x" %></button>
|
||||
<h3 class="Box-title overflow-hidden pr-3">A very long title that wraps onto multiple lines without overlapping or wrapping underneath the icon to it's right</h3>
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
```erb
|
||||
<div class="Box">
|
||||
<div class="Box-row clearfix">
|
||||
<button href="#" class="Box-btn-octicon btn-octicon float-left"><%= octicon "check" %></button>
|
||||
<p class="overflow-hidden pl-3">A very long paragraph that wraps onto multiple lines without overlapping or wrapping underneath the icon to it's left</p>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Box headers with counters
|
||||
Use a counter with a background that works against the contrast of the box header. The default counter colors do not stand out well against the header background so we suggest using one of the following styles:
|
||||
|
||||
Use `Counter--gray` for a counter with a gray background and dark gray text.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-header">
|
||||
<h3 class="Box-title">
|
||||
Box title
|
||||
<span class="Counter Counter--gray">12</span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
Use `Counter--gray-dark` for a counter with a dark gray background and white text.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-header">
|
||||
<h3 class="Box-title">
|
||||
Box title
|
||||
<span class="Counter Counter--gray-dark">12</span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Form elements and buttons in boxes
|
||||
To achieve different layouts when adding buttons or form elements to boxes we suggest you use utilities to achieve the layout you want. Here's some common examples:
|
||||
|
||||
Use [flexbox utilities](/css/utilities/flexbox) to center align items, and avoid using floats by using `flex-auto` to have the text fill the remaining space so that the button rests on the far right.
|
||||
|
||||
```html
|
||||
<div class="Box Box--condensed">
|
||||
<div class="Box-header d-flex flex-items-center">
|
||||
<h3 class="Box-title overflow-hidden flex-auto">
|
||||
Box title
|
||||
</h3>
|
||||
<button class="btn btn-primary btn-sm">
|
||||
Button
|
||||
</button>
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
A similar approach can be used for buttons with multiple lines of text within a row.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-row d-flex flex-items-center">
|
||||
<div class="flex-auto">
|
||||
<strong>Row title</strong>
|
||||
<div class="text-small text-gray-light">
|
||||
Description
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" name="button">View</button>
|
||||
</div>
|
||||
<div class="Box-row d-flex flex-items-center">
|
||||
<div class="flex-auto">
|
||||
<strong>Row title</strong>
|
||||
<div class="text-small text-gray-light">
|
||||
Description
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" name="button">View</button>
|
||||
</div>
|
||||
<div class="Box-row d-flex flex-items-center">
|
||||
<div class="flex-auto">
|
||||
<strong>Row title</strong>
|
||||
<div class="text-small text-gray-light">
|
||||
Description
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" name="button">View</button>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
Using flexbox along with form, button, and link styles, you can create more complex box headers for things like bulk actions and sorting.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-header d-flex flex-items-center">
|
||||
<form class="flex-auto">
|
||||
<label>
|
||||
<input class="mr-1" type="checkbox">
|
||||
Check it
|
||||
</label>
|
||||
</form>
|
||||
<button class="btn-link select-menu-button muted-link">
|
||||
Select menu
|
||||
</button>
|
||||
</div>
|
||||
<div class="Box-body">
|
||||
Box body
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
You can put forms in boxes. Often form submission buttons are aligned to the bottom right of the form which you can do with `text-right` instead of using floats.
|
||||
|
||||
```html
|
||||
<div class="Box">
|
||||
<div class="Box-header">
|
||||
<h3 class="Box-title">
|
||||
Example form title
|
||||
</h3>
|
||||
</div>
|
||||
<form>
|
||||
<div class="Box-body">
|
||||
<dl class="form-group">
|
||||
<dt><label>Example label</label></dt>
|
||||
<dd><input class="form-control" type="text"></dd>
|
||||
</dl>
|
||||
<div class="form-checkbox">
|
||||
<label>
|
||||
<input type="checkbox" checked="checked">
|
||||
Yes please
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="Box-footer text-right">
|
||||
<button class="btn btn-secondary mr-1">
|
||||
Cancel
|
||||
</button>
|
||||
<button class="btn btn-primary">
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
```
|
||||
|
||||
When a box is all by itself centered on a page you can use [column widths](/css/objects/grid) to control the width of the box. If needed, break the mold a little and use [typography utilities](/css/utilities/typography) instead of the built in box title styles.
|
||||
|
||||
```html
|
||||
<div class="Box Box--spacious col-6 mx-auto text-center">
|
||||
<form>
|
||||
<div class="Box-body">
|
||||
<h3 class="f1-light">
|
||||
Example form
|
||||
</h3>
|
||||
<dl class="form-group mb-4">
|
||||
<dt><label>Example label</label></dt>
|
||||
<dd><input class="form-control" type="text"></dd>
|
||||
</dl>
|
||||
<button class="btn btn-primary btn-block">
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
```
|
||||
|
||||
Box patterns can also be made with, and modified with [border utilities](/css/utilities/borders).
|
||||
|
||||
<!-- %enddocs -->
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) © [GitHub](https://github.com/)
|
||||
|
||||
[primer]: https://github.com/primer/primer
|
||||
[docs]: http://primer.github.io/
|
||||
[npm]: https://www.npmjs.com/
|
||||
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
|
||||
[sass]: http://sass-lang.com/
|
|
@ -1 +0,0 @@
|
|||
.Box{background-color:#fff;border:1px solid #d1d5da;border-radius:3px}.Box--condensed{line-height:1.25}.Box--condensed .Box-header{padding:8px 16px}.Box--condensed .Box-body{padding:8px 16px}.Box--condensed .Box-footer{padding:8px 16px}.Box--condensed .Box-btn-octicon.btn-octicon{padding:8px 16px;margin:-8px -16px;line-height:1.25}.Box--condensed .Box-row{padding:8px 16px}.Box--spacious .Box-header{padding:24px;line-height:1.25}.Box--spacious .Box-title{font-size:20px}.Box--spacious .Box-body{padding:24px}.Box--spacious .Box-footer{padding:24px}.Box--spacious .Box-btn-octicon.btn-octicon{padding:24px;margin:-24px -24px}.Box--spacious .Box-row{padding:24px}.Box-header{padding:16px;margin:-1px -1px 0 -1px;background-color:#f6f8fa;border-color:#d1d5da;border-style:solid;border-width:1px;border-top-left-radius:3px;border-top-right-radius:3px}.Box-title{font-size:14px;font-weight:600}.Box-body{padding:16px;border-bottom:1px solid #e1e4e8}.Box-body:last-of-type{margin-bottom:-1px;border-bottom-right-radius:2px;border-bottom-left-radius:2px}.Box-row{padding:16px;margin-top:-1px;list-style-type:none;border-top:1px solid #e1e4e8}.Box-row:first-of-type{border-top-color:transparent;border-top-left-radius:2px;border-top-right-radius:2px}.Box-row:last-of-type{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.Box-row.Box-row--unread,.Box-row.unread{box-shadow:2px 0 0 #0366d6 inset}.Box-row.navigation-focus .Box-row--drag-button{color:#0366d6;cursor:grab;opacity:100}.Box-row.navigation-focus.is-dragging .Box-row--drag-button{cursor:grabbing}.Box-row.navigation-focus.sortable-chosen{background-color:#fafbfc}.Box-row.navigation-focus.sortable-ghost{background-color:#f6f8fa}.Box-row.navigation-focus.sortable-ghost .Box-row--drag-hide{opacity:0}.Box-row--focus-gray.navigation-focus{background-color:#f6f8fa}.Box-row--focus-blue.navigation-focus{background-color:#f1f8ff}.Box-row--hover-gray:hover{background-color:#f6f8fa}.Box-row--hover-blue:hover{background-color:#f1f8ff}@media (min-width: 768px){.Box-row-link{color:#24292e;text-decoration:none}.Box-row-link:hover{color:#0366d6;text-decoration:none}}.Box-row--drag-button{opacity:0}.Box-footer{padding:16px;margin-top:-1px;border-top:1px solid #e1e4e8}.Box--scrollable{max-height:324px;overflow:scroll}.Box--blue{border-color:#c8e1ff}.Box--blue .Box-header{background-color:#f1f8ff;border-color:#c8e1ff}.Box--blue .Box-body{border-color:#c8e1ff}.Box--blue .Box-row{border-color:#c8e1ff}.Box--blue .Box-footer{border-color:#c8e1ff}.Box--danger{border-color:#d73a49}.Box--danger .Box-row:first-of-type{border-color:#d73a49}.Box--danger .Box-body:last-of-type{border-color:#d73a49}.Box-header--blue{background-color:#f1f8ff;border-color:#c8e1ff}.Box-row--yellow{background-color:#fffbdd}.Box-row--blue{background-color:#f1f8ff}.Box-row--gray{background-color:#f6f8fa}.Box-btn-octicon.btn-octicon{padding:16px 16px;margin:-16px -16px;line-height:1.5}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,2 +0,0 @@
|
|||
@import "primer-support/index.scss";
|
||||
@import "./lib/box.scss";
|
|
@ -1,284 +0,0 @@
|
|||
// Box
|
||||
// Intended to replace simple-box, boxed-group, and table-list
|
||||
|
||||
.Box {
|
||||
background-color: $white;
|
||||
border: $border-width $border-style $border-gray-dark;
|
||||
border-radius: $border-radius;
|
||||
}
|
||||
|
||||
// Box padding density options
|
||||
.Box--condensed {
|
||||
line-height: $lh-condensed;
|
||||
|
||||
.Box-header {
|
||||
padding: $spacer-2 $spacer-3;
|
||||
}
|
||||
|
||||
.Box-body {
|
||||
padding: $spacer-2 $spacer-3;
|
||||
}
|
||||
|
||||
.Box-footer {
|
||||
padding: $spacer-2 $spacer-3;
|
||||
}
|
||||
|
||||
.Box-btn-octicon {
|
||||
&.btn-octicon {
|
||||
padding: $spacer-2 $spacer-3;
|
||||
margin: (-$spacer-2) (-$spacer-3);
|
||||
line-height: $lh-condensed;
|
||||
}
|
||||
}
|
||||
|
||||
.Box-row {
|
||||
padding: $spacer-2 $spacer-3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.Box--spacious {
|
||||
.Box-header {
|
||||
padding: $spacer-4;
|
||||
line-height: $lh-condensed;
|
||||
}
|
||||
|
||||
.Box-title {
|
||||
font-size: $h3-size;
|
||||
}
|
||||
|
||||
.Box-body {
|
||||
padding: $spacer-4;
|
||||
}
|
||||
|
||||
.Box-footer {
|
||||
padding: $spacer-4;
|
||||
}
|
||||
|
||||
.Box-btn-octicon {
|
||||
&.btn-octicon {
|
||||
padding: $spacer-4;
|
||||
margin: (-$spacer-4) (-$spacer-4);
|
||||
}
|
||||
}
|
||||
|
||||
.Box-row {
|
||||
padding: $spacer-4;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.Box-header {
|
||||
padding: $spacer-3;
|
||||
margin: -1px -1px 0 -1px;
|
||||
background-color: $bg-gray;
|
||||
border-color: $border-gray-dark;
|
||||
border-style: $border-style;
|
||||
border-width: $border-width;
|
||||
border-top-left-radius: $border-radius;
|
||||
border-top-right-radius: $border-radius;
|
||||
}
|
||||
|
||||
.Box-title {
|
||||
font-size: $body-font-size;
|
||||
font-weight: $font-weight-bold;
|
||||
}
|
||||
|
||||
.Box-body {
|
||||
padding: $spacer-3;
|
||||
border-bottom: $border-width $border-style $border-gray;
|
||||
|
||||
// Ensures bottom-border doesn't poke out when .Box-body used without box-footer
|
||||
&:last-of-type {
|
||||
margin-bottom: -1px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
// Box rows
|
||||
.Box-row {
|
||||
padding: $spacer-3;
|
||||
margin-top: -1px;
|
||||
list-style-type: none; // To account for applying Box component to a list
|
||||
border-top: $border-width $border-style $border-gray;
|
||||
|
||||
&:first-of-type {
|
||||
border-top-color: transparent;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom-right-radius: 2px;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
|
||||
// Adds a blue vertical line to the left of the row
|
||||
// For indicating a row item is unread
|
||||
&.Box-row--unread,
|
||||
// .unread to be deprecated with .Box-row-unread
|
||||
&.unread {
|
||||
box-shadow: 2px 0 0 $blue inset;
|
||||
}
|
||||
|
||||
&.navigation-focus {
|
||||
// Focus styles for when drag icon
|
||||
.Box-row--drag-button {
|
||||
color: $text-blue;
|
||||
cursor: grab;
|
||||
opacity: 100;
|
||||
}
|
||||
|
||||
// Grabbing while row is dragged
|
||||
&.is-dragging .Box-row--drag-button {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
// Row dragging styles
|
||||
&.sortable-chosen {
|
||||
background-color: $bg-gray-light;
|
||||
}
|
||||
|
||||
// Makes dragging row background gray
|
||||
&.sortable-ghost {
|
||||
background-color: $bg-gray;
|
||||
|
||||
// Hides contents of row while dragging so row looks solid gray
|
||||
.Box-row--drag-hide {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.Box-row--focus-gray {
|
||||
&.navigation-focus {
|
||||
background-color: $bg-gray;
|
||||
}
|
||||
}
|
||||
|
||||
.Box-row--focus-blue {
|
||||
&.navigation-focus {
|
||||
background-color: $bg-blue-light;
|
||||
}
|
||||
}
|
||||
|
||||
.Box-row--hover-gray {
|
||||
&:hover {
|
||||
background-color: $bg-gray;
|
||||
}
|
||||
}
|
||||
|
||||
.Box-row--hover-blue {
|
||||
&:hover {
|
||||
background-color: $bg-blue-light;
|
||||
}
|
||||
}
|
||||
|
||||
// Optional link style
|
||||
// Makes links on mobile blue since they don't have hover state,
|
||||
// and links are dark-gray with blue hover on desktop.
|
||||
.Box-row-link {
|
||||
@include breakpoint(md) {
|
||||
|
||||
color: $text-gray-dark;
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
color: $text-blue;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Optional drag icon styles for reordering items
|
||||
// Focus styles included in .Box-row above
|
||||
.Box-row--drag-button {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.Box-footer {
|
||||
padding: $spacer-3;
|
||||
margin-top: -1px; // prevents double border when used with .Box-body
|
||||
border-top: $border-width $border-style $border-gray;
|
||||
}
|
||||
|
||||
// Option for a box with scrolling content
|
||||
.Box--scrollable {
|
||||
max-height: 324px;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
// Box themes
|
||||
|
||||
.Box--blue {
|
||||
border-color: $border-blue-light;
|
||||
|
||||
.Box-header {
|
||||
background-color: $bg-blue-light;
|
||||
border-color: $border-blue-light;
|
||||
}
|
||||
|
||||
.Box-body {
|
||||
border-color: $border-blue-light;
|
||||
}
|
||||
|
||||
.Box-row {
|
||||
border-color: $border-blue-light;
|
||||
}
|
||||
|
||||
.Box-footer {
|
||||
border-color: $border-blue-light;
|
||||
}
|
||||
}
|
||||
|
||||
// Applies and red border to the outside of the box,
|
||||
// but not to the border separating rows.
|
||||
.Box--danger {
|
||||
border-color: $border-red;
|
||||
|
||||
.Box-row {
|
||||
&:first-of-type {
|
||||
border-color: $border-red;
|
||||
}
|
||||
}
|
||||
|
||||
.Box-body {
|
||||
&:last-of-type {
|
||||
border-color: $border-red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.Box-header--blue {
|
||||
background-color: $bg-blue-light;
|
||||
border-color: $border-blue-light;
|
||||
}
|
||||
|
||||
// Box row highlight themes
|
||||
|
||||
.Box-row--yellow {
|
||||
background-color: $yellow-100;
|
||||
}
|
||||
|
||||
.Box-row--blue {
|
||||
background-color: $bg-blue-light;
|
||||
}
|
||||
|
||||
.Box-row--gray {
|
||||
background-color: $bg-gray;
|
||||
}
|
||||
|
||||
//Box with btn-octicon
|
||||
.Box-btn-octicon {
|
||||
|
||||
// Increase specificity when btn-octicon is used because comes after .Box in the cascade
|
||||
&.btn-octicon {
|
||||
padding: $spacer-3 $spacer-3;
|
||||
margin: (-$spacer-3) (-$spacer-3);
|
||||
line-height: $lh-default; // override btn-octicon line-height
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
{
|
||||
"_from": "primer-box@2.5.13",
|
||||
"_id": "primer-box@2.5.13",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ZNZ8TFU05gqZx1oSk6DVdjACOOPsdJZqn0qYBcfsEu+AQQiKJ7HVH8pgODlH5tqj8Ihtoz3Q1CxCmrZhVnjnbA==",
|
||||
"_location": "/primer-box",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "primer-box@2.5.13",
|
||||
"name": "primer-box",
|
||||
"escapedName": "primer-box",
|
||||
"rawSpec": "2.5.13",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.5.13"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/primer-core"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/primer-box/-/primer-box-2.5.13.tgz",
|
||||
"_shasum": "126216f3b18bd51679aa5f055a9ef373cd326f5d",
|
||||
"_spec": "primer-box@2.5.13",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/primer-core",
|
||||
"author": {
|
||||
"name": "GitHub, Inc."
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"primer-support": "4.7.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A module for creating rounded-corner boxes with options for headers, lists, and footers.",
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"homepage": "http://primer.github.io/",
|
||||
"keywords": [
|
||||
"primer",
|
||||
"css",
|
||||
"github",
|
||||
"design-system"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "primer-box",
|
||||
"primer": {
|
||||
"category": "core",
|
||||
"module_type": "components"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/primer/primer/tree/master/modules/primer-box"
|
||||
},
|
||||
"sass": "index.scss",
|
||||
"scripts": {
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"lint": "../../script/lint-scss",
|
||||
"postpublish": "../../script/notify success",
|
||||
"prepare": "npm run build",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"test": "../../script/npm-run-all build lint"
|
||||
},
|
||||
"style": "build/build.css",
|
||||
"version": "2.5.13"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,48 +0,0 @@
|
|||
# Primer Breadcrumb Navigation
|
||||
|
||||
[![npm version](https://img.shields.io/npm/v/primer-breadcrumb.svg)](https://www.npmjs.org/package/primer-breadcrumb)
|
||||
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)
|
||||
|
||||
> Breadcrumb navigation for GitHub's pages with parents / grandparents.
|
||||
|
||||
This repository is a module of the full [primer][primer] repository.
|
||||
|
||||
## Documentation
|
||||
|
||||
<!-- %docs
|
||||
title: Breadcrumbs
|
||||
path: components/breadcrumb
|
||||
status: Stable
|
||||
-->
|
||||
|
||||
Breadcrumbs are used to show taxonomical context on pages that are many levels deep in a site’s hierarchy. Breadcrumbs show and link to parent, grandparent, and sometimes great-grandparent pages. Breadcrumbs are most appropriate on pages that:
|
||||
|
||||
- Are many levels deep on a site
|
||||
- Do not have a section-level navigation
|
||||
- May need the ability to quickly go back to the previous (parent) page
|
||||
|
||||
#### Usage
|
||||
|
||||
```html title="Breadcrumb"
|
||||
<nav aria-label="Breadcrumb">
|
||||
<ol>
|
||||
<li class="breadcrumb-item text-small"><a href="https://github.com/business">Business</a></li>
|
||||
<li class="breadcrumb-item text-small"><a href="https://github.com/business/customers">Customers</a></li>
|
||||
<li class="breadcrumb-item breadcrumb-item-selected text-small text-gray" aria-current="page">MailChimp</li>
|
||||
</ol>
|
||||
</nav>
|
||||
```
|
||||
|
||||
<!-- %enddocs -->
|
||||
|
||||
## License
|
||||
|
||||
MIT © [GitHub](https://github.com/)
|
||||
|
||||
[primer]: https://github.com/primer/primer
|
||||
[primer-support]: https://github.com/primer/primer-support
|
||||
[support]: https://github.com/primer/primer-support
|
||||
[docs]: http://primer.github.io/
|
||||
[npm]: https://www.npmjs.com/
|
||||
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
|
||||
[sass]: http://sass-lang.com/
|
|
@ -1 +0,0 @@
|
|||
.breadcrumb-item{display:inline-block;margin-left:-0.35em;white-space:nowrap;list-style:none}.breadcrumb-item::after{padding-right:.5em;padding-left:.5em;color:#e1e4e8;content:"/"}.breadcrumb-item:first-child{margin-left:0}.breadcrumb-item-selected::after{content:none}
|
|
@ -1 +0,0 @@
|
|||
{"cssstats":{"size":270,"gzipSize":178,"humanizedSize":"270B","humanizedGzipSize":"178B","rules":{"total":4,"size":{"graph":[4,4,1,1],"max":4,"average":2.5},"selectorByRuleSizes":[{"selector":".breadcrumb-item::after","declarations":4},{"selector":".breadcrumb-item","declarations":4},{"selector":".breadcrumb-item-selected::after","declarations":1},{"selector":".breadcrumb-item:first-child","declarations":1}]},"selectors":{"total":4,"type":0,"class":4,"id":0,"pseudoClass":1,"pseudoElement":2,"values":[".breadcrumb-item",".breadcrumb-item::after",".breadcrumb-item:first-child",".breadcrumb-item-selected::after"],"specificity":{"max":20,"average":13}},"declarations":{"total":10,"unique":10,"properties":{"display":["inline-block"],"margin-left":["-0.35em","0"],"white-space":["nowrap"],"list-style":["none"],"padding-right":[".5em"],"padding-left":[".5em"],"color":["#e1e4e8"],"content":["\"/\"","none"]}},"mediaQueries":{"total":0,"unique":0,"values":[],"contents":[]}}}
|
|
@ -1 +0,0 @@
|
|||
module.exports = {"cssstats":{"size":270,"gzipSize":178,"humanizedSize":"270B","humanizedGzipSize":"178B","rules":{"total":4,"size":{"graph":[4,4,1,1],"max":4,"average":2.5},"selectorByRuleSizes":[{"selector":".breadcrumb-item::after","declarations":4},{"selector":".breadcrumb-item","declarations":4},{"selector":".breadcrumb-item-selected::after","declarations":1},{"selector":".breadcrumb-item:first-child","declarations":1}]},"selectors":{"total":4,"type":0,"class":4,"id":0,"pseudoClass":1,"pseudoElement":2,"values":[".breadcrumb-item",".breadcrumb-item::after",".breadcrumb-item:first-child",".breadcrumb-item-selected::after"],"specificity":{"max":20,"average":13}},"declarations":{"total":10,"unique":10,"properties":{"display":["inline-block"],"margin-left":["-0.35em","0"],"white-space":["nowrap"],"list-style":["none"],"padding-right":[".5em"],"padding-left":[".5em"],"color":["#e1e4e8"],"content":["\"/\"","none"]}},"mediaQueries":{"total":0,"unique":0,"values":[],"contents":[]}}}
|
|
@ -1,3 +0,0 @@
|
|||
// support files
|
||||
@import "primer-support/index.scss";
|
||||
@import "./lib/breadcrumb.scss";
|
|
@ -1,23 +0,0 @@
|
|||
.breadcrumb-item {
|
||||
display: inline-block;
|
||||
margin-left: -0.35em;
|
||||
white-space: nowrap;
|
||||
list-style: none;
|
||||
|
||||
&::after {
|
||||
padding-right: $em-spacer-5;
|
||||
padding-left: $em-spacer-5;
|
||||
color: $border-gray;
|
||||
content: "/";
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.breadcrumb-item-selected {
|
||||
&::after {
|
||||
content: none;
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
{
|
||||
"_from": "primer-breadcrumb@1.5.9",
|
||||
"_id": "primer-breadcrumb@1.5.9",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-A2+rm3Gi2vk4LYr8yWrNwYNc2i59gcnfAGyT/QJ7G66R0kLD8M3rIPDw2vmRY5LagTvZ8KnY6wRwc5GSSKVBDQ==",
|
||||
"_location": "/primer-breadcrumb",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "primer-breadcrumb@1.5.9",
|
||||
"name": "primer-breadcrumb",
|
||||
"escapedName": "primer-breadcrumb",
|
||||
"rawSpec": "1.5.9",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.5.9"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/primer-core"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/primer-breadcrumb/-/primer-breadcrumb-1.5.9.tgz",
|
||||
"_shasum": "24c557c925e9cf29f551a0ff2622f4abb1d7c22c",
|
||||
"_spec": "primer-breadcrumb@1.5.9",
|
||||
"_where": "/Users/brandonrosage/github/profile-generator/node_modules/primer-core",
|
||||
"author": {
|
||||
"name": "GitHub, Inc."
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"primer-support": "4.7.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Breadcrumb navigation for pages with parents / grandparents.",
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"homepage": "http://primer.github.io/",
|
||||
"keywords": [
|
||||
"breadcrumb",
|
||||
"css",
|
||||
"github",
|
||||
"navigation",
|
||||
"primer",
|
||||
"design-system",
|
||||
"style"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"name": "primer-breadcrumb",
|
||||
"primer": {
|
||||
"category": "core",
|
||||
"module_type": "components"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/primer/primer/tree/master/modules/primer-breadcrumb"
|
||||
},
|
||||
"sass": "index.scss",
|
||||
"scripts": {
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"lint": "../../script/lint-scss",
|
||||
"postpublish": "../../script/notify success",
|
||||
"prepare": "npm run build",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"test": "../../script/npm-run-all build lint test-docs",
|
||||
"test-docs": "../../script/test-docs"
|
||||
},
|
||||
"style": "build/build.css",
|
||||
"version": "1.5.9"
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,278 +0,0 @@
|
|||
# Primer Buttons
|
||||
|
||||
[![npm version](https://img.shields.io/npm/v/primer-buttons.svg)](https://www.npmjs.org/package/primer-buttons)
|
||||
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)
|
||||
|
||||
> Buttons are used for actions, like in forms, while textual hyperlinks are used for destinations, or moving from one page to another.
|
||||
|
||||
This repository is a module of the full [primer][primer] repository.
|
||||
|
||||
## Install
|
||||
|
||||
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-buttons` with this command.
|
||||
|
||||
```
|
||||
$ npm install --save primer-buttons
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The source files included are written in [Sass][sass] (`scss`) You can simply point your sass `include-path` at your `node_modules` directory and import it like this.
|
||||
|
||||
```scss
|
||||
@import "primer-buttons/index.scss";
|
||||
```
|
||||
|
||||
You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._
|
||||
|
||||
## Build
|
||||
|
||||
For a compiled **css** version of this module, a npm script is included that will output a css version to `build/build.css` The built css file is also included in the npm package.
|
||||
|
||||
```
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
<!-- %docs
|
||||
title: Buttons
|
||||
path: components/buttons
|
||||
status: Stable
|
||||
-->
|
||||
|
||||
Buttons are used for **actions**, like in forms, while textual hyperlinks are used for **destinations**, or moving from one page to another.
|
||||
|
||||
{:toc}
|
||||
|
||||
## Default button
|
||||
|
||||
Use the standard—yet classy—`.btn` for form actions and primary page actions. These are used extensively around the site.
|
||||
|
||||
When using a `<button>` element, **always specify a `type`**. When using a `<a>` element, **always add `role="button"` for accessibility**.
|
||||
|
||||
```html
|
||||
<button class="btn" type="button">Button button</button>
|
||||
<a class="btn" href="#url" role="button">Link button</a>
|
||||
```
|
||||
|
||||
You can find them in two sizes: the default `.btn` and the smaller `.btn-sm`.
|
||||
|
||||
```html
|
||||
<button class="btn" type="button">Button</button>
|
||||
<button class="btn btn-sm" type="button">Small button</button>
|
||||
```
|
||||
|
||||
## Primary button
|
||||
|
||||
Primary buttons are green and are used to indicate the *primary* action on a page. When you need your buttons to stand out, use `.btn.btn-primary`. You can use it with both button sizes—just add `.btn-primary`.
|
||||
|
||||
```html
|
||||
<button class="btn btn-primary" type="button">Primary button</button>
|
||||
<button class="btn btn-sm btn-primary" type="button">Small primary button</button>
|
||||
```
|
||||
|
||||
## Danger button
|
||||
|
||||
Danger buttons are red. They help reiterate that the intended action is important or potentially dangerous (e.g., deleting a repo or transferring ownership). Similar to the primary buttons, just add `.btn-danger`.
|
||||
|
||||
```html
|
||||
<button class="btn btn-danger" type="button">Danger button</button>
|
||||
<button class="btn btn-sm btn-danger" type="button">Small danger button</button>
|
||||
```
|
||||
|
||||
## Outline button
|
||||
|
||||
Outline buttons downplay an action as they appear like boxy links. Just add `.btn-outline` and go.
|
||||
|
||||
```html
|
||||
<button class="btn btn-outline" type="button">Outline button</button>
|
||||
<button class="btn btn-sm btn-outline" type="button">Outline button</button>
|
||||
```
|
||||
|
||||
## Large button
|
||||
Use `.btn-large` to increase the padding and border radius of a button. This is useful for prominent calls to action in hero sections.
|
||||
|
||||
[Type scale utilities](https://styleguide.github.com/primer/utilities/typography/#type-scale-utilities) can be used to alter the font-size if needed. Padding is applied in em's so that it scales proportionally with the font-size.
|
||||
|
||||
```html
|
||||
<p>
|
||||
<a class="btn btn-large btn-purple" href="#url" role="button">Large link button</a>
|
||||
<button class="btn btn-large" type="button">Large button button</button>
|
||||
</p>
|
||||
|
||||
```
|
||||
|
||||
Use `.btn-large` with a type scale utility to transform the text to a bigger size.
|
||||
|
||||
```html
|
||||
<p class="f3">
|
||||
<a class="btn btn-large btn-purple" href="#url" role="button">Large link button</a>
|
||||
<button class="btn btn-large btn-outline-blue" type="button">Large button button</button>
|
||||
</p>
|
||||
```
|
||||
|
||||
## Disabled state
|
||||
|
||||
Disable `<button>` elements with the boolean `disabled` attribute and `<a>` elements with the `.disabled` class.
|
||||
|
||||
```html
|
||||
<button class="btn" type="button" disabled>Disabled button</button>
|
||||
<a class="btn disabled" href="#url" role="button">Disabled button</a>
|
||||
```
|
||||
|
||||
Similar styles are applied to primary, danger, and outline buttons:
|
||||
|
||||
```html
|
||||
<button class="btn btn-primary" type="button" disabled>Disabled button</button>
|
||||
<a class="btn btn-primary disabled" href="#url" role="button">Disabled button</a>
|
||||
```
|
||||
|
||||
```html
|
||||
<button class="btn btn-danger" type="button" disabled>Disabled button</button>
|
||||
<a class="btn btn-danger disabled" href="#url" role="button">Disabled button</a>
|
||||
```
|
||||
|
||||
```html
|
||||
<button class="btn btn-outline" type="button" disabled>Disabled button</button>
|
||||
<a class="btn btn-outline disabled" href="#url" role="button">Disabled button</a>
|
||||
```
|
||||
|
||||
## Block button
|
||||
|
||||
Make any button full-width by adding `.btn-block`. It adds `width: 100%;`, changes the `display` from `inline-block` to `block`, and centers the button text.
|
||||
|
||||
```html
|
||||
<p><button class="btn btn-block" type="button">Block button</button></p>
|
||||
<p><button class="btn btn-sm btn-block" type="button">Small block button</button></p>
|
||||
```
|
||||
|
||||
## Link button
|
||||
|
||||
Create a button that looks like a link with `.btn-link`. Rather than using an `<a>` to trigger JS, this style on a `<button>` should be used for better accessibility.
|
||||
|
||||
**The `.btn-link` class is not designed to be used with `.btn`; the overlapping styles are not compatible.**
|
||||
|
||||
```html
|
||||
<p><button class="btn-link" type="button">Link button</button></p>
|
||||
```
|
||||
|
||||
## Button with counts
|
||||
|
||||
You can easily append a count to a **small button**. Add the `.with-count` class to the `.btn-sm` and then add the `.social-count` after the button.
|
||||
|
||||
**Be sure to clear the float added by the additional class.**
|
||||
|
||||
```erb
|
||||
<div class="clearfix">
|
||||
<a class="btn btn-sm btn-with-count" href="#url" role="button">
|
||||
<%= octicon "eye" %>
|
||||
Watch
|
||||
</a>
|
||||
<a class="social-count" href="#url">6</a>
|
||||
</div>
|
||||
```
|
||||
|
||||
You can also use the [counter](./labels#counters) component within buttons:
|
||||
|
||||
```html
|
||||
<button class="btn" type="button">
|
||||
Button
|
||||
<span class="Counter">12</span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-primary" type="button">
|
||||
Button
|
||||
<span class="Counter">12</span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-danger" type="button">
|
||||
Button
|
||||
<span class="Counter">12</span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-outline" type="button">
|
||||
Button
|
||||
<span class="Counter">12</span>
|
||||
</button>
|
||||
```
|
||||
|
||||
## Button groups
|
||||
|
||||
Have a hankering for a series of buttons that are attached to one another? Wrap them in a `.BtnGroup` and the buttons will be rounded and spaced automatically.
|
||||
|
||||
```html
|
||||
<div class="BtnGroup mr-2">
|
||||
<button class="btn BtnGroup-item" type="button">Button</button>
|
||||
<button class="btn BtnGroup-item" type="button">Button</button>
|
||||
<button class="btn BtnGroup-item" type="button">Button</button>
|
||||
</div>
|
||||
|
||||
<div class="BtnGroup mr-2">
|
||||
<button class="btn BtnGroup-item btn-outline" type="button">Button</button>
|
||||
<button class="btn BtnGroup-item btn-outline" type="button">Button</button>
|
||||
<button class="btn BtnGroup-item btn-outline" type="button">Button</button>
|
||||
</div>
|
||||
|
||||
<div class="BtnGroup">
|
||||
<button class="btn BtnGroup-item btn-sm" type="button">Button</button>
|
||||
<button class="btn BtnGroup-item btn-sm" type="button">Button</button>
|
||||
<button class="btn BtnGroup-item btn-sm" type="button">Button</button>
|
||||
</div>
|
||||
```
|
||||
|
||||
Add `.BtnGroup-parent` to parent elements, like `<form>`s or `<details>`s, within `.BtnGroup`s for proper spacing and rounded corners.
|
||||
|
||||
```html
|
||||
<div class="BtnGroup">
|
||||
<button class="btn BtnGroup-item" type="button">Button</button>
|
||||
<form class="BtnGroup-parent">
|
||||
<button class="btn BtnGroup-item" type="button">Button in a form</button>
|
||||
</form>
|
||||
<button class="btn BtnGroup-item" type="button">Button</button>
|
||||
<button class="btn BtnGroup-item" type="button">Button</button>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Hidden text button
|
||||
|
||||
Use `.hidden-text-expander` to indicate and toggle hidden text.
|
||||
|
||||
```html
|
||||
<span class="hidden-text-expander">
|
||||
<button type="button" class="ellipsis-expander" aria-expanded="false">…</button>
|
||||
</span>
|
||||
```
|
||||
|
||||
You can also make the expander appear inline by adding `.inline`.
|
||||
|
||||
|
||||
## Using button styles with the details summary element
|
||||
|
||||
You can add `.btn` and `.btn-*` classes to any
|
||||
[`<summary>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary)
|
||||
element so that it gains the appearance of a button, and
|
||||
selected/active styles when the parent
|
||||
[`<details>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details)
|
||||
element is open.
|
||||
|
||||
```html
|
||||
<details>
|
||||
<summary class="btn btn-block btn-primary">Toggle the content</summary>
|
||||
<p class="mt-2">
|
||||
This content will be toggled.
|
||||
</p>
|
||||
</details>
|
||||
```
|
||||
|
||||
<!-- %enddocs -->
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) © [GitHub](https://github.com/)
|
||||
|
||||
[primer]: https://github.com/primer/primer
|
||||
[docs]: http://primer.github.io/
|
||||
[npm]: https://www.npmjs.com/
|
||||
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
|
||||
[sass]: http://sass-lang.com/
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче