├── .gitignore
├── tags
├── demo.md
└── documentation.md
├── bin
├── ls-tags
├── mk-index
└── mk-site
├── _config.yml
├── README.md
├── sitemap.xml
├── LICENSE
├── introduction.md
├── feed.atom
├── demo-note.md
├── setup.markdown
├── _layouts
└── default.html
└── assets
└── css
└── style.scss
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/tags/demo.md:
--------------------------------------------------------------------------------
1 | # demo
2 |
3 | - *2019-06-05* [demo-note](./demo-note)
4 |
--------------------------------------------------------------------------------
/bin/ls-tags:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | git ls-files '*.md' '*.markdown' | grep -v README | xargs -n1 -I {} grep -m1 "tags:" {} | sed s/tags:\ //g | tr ' ' '\n' | sort -u
4 |
--------------------------------------------------------------------------------
/bin/mk-index:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | xargs -n1 -I {} grep -H -m1 "date:" {} | sed s/\.md:date://g | sed s/\.markdown:date://g | awk '{print "- *"$2"* ["$1"](./"$1")"}' | sort -r
4 |
--------------------------------------------------------------------------------
/tags/documentation.md:
--------------------------------------------------------------------------------
1 | # documentation
2 |
3 | - *2019-06-07* [introduction](./introduction)
4 | - *2019-06-06* [setup](./setup)
5 | - *2019-06-05* [demo-note](./demo-note)
6 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | # the name for your notes website
2 | name: Precis
3 |
4 | # the description of the notes website
5 | description: Precis is a minimal note taking web-app built over Github Pages. This website itself is built using Precis. Look at the notes below to learn about it.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Precis
2 |
3 | Precis is a minimal note taking web-app built over Github Pages. This website itself is built using Precis. Look at the notes below to learn about it.
4 |
5 | ## Tags
6 |
7 | - [demo](./tags/demo)
8 | - [documentation](./tags/documentation)
9 |
10 | ## Notes
11 |
12 | - *2019-06-07* [introduction](./introduction)
13 | - *2019-06-06* [setup](./setup)
14 | - *2019-06-05* [demo-note](./demo-note)
15 |
--------------------------------------------------------------------------------
/sitemap.xml:
--------------------------------------------------------------------------------
1 | ---
2 | layout: null
3 | ---
4 |
5 |
8 | {% for page in site.pages %}
9 | {% assign page_ext = page.name | split: "." | last | downcase %}
10 | {% if page_ext == "md" or page_ext == "markdown" %}
11 |
12 | {{ site.github.url }}{{ page.url | split: "." | first }}
13 |
14 | {% if page.date %}
15 | {{ page.date | date_to_xmlschema }}
16 | {% else %}
17 | {{ site.time | date_to_xmlschema }}
18 | {% endif %}
19 |
20 | weekly
21 | 0.5
22 |
23 | {% endif %}
24 | {% endfor %}
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Abhinav Sarkar
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/introduction.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2019-06-07
3 | tags: documentation
4 | ---
5 |
6 | # Precis Introduction
7 |
8 | Precis is a minimal note taking web-app built over Github Pages.
9 |
10 | ## Features
11 |
12 | - Use your favorite editor to write your notes in [Markdown].
13 | - Notes are versioned using git.
14 | - Notes support tags for categorization.
15 | - Read the notes on any device using the generated website.
16 | - Edit the notes on any device using Github's editing UI.
17 | - Do full-text search of your notes.
18 | - Syntax highlighting for code using [rouge].
19 | - Minimal responsive styling using [ReMarkdown.css].
20 | - Dark mode support.
21 | - Automatic Sitemap and Atom feed generation for notes.
22 | - No dependencies other than basic *nix commands.
23 | - Free public hosting using [Github Pages].
24 |
25 | See [setup](./setup) for setup instructions.
26 |
27 | ## Examples
28 |
29 | -
30 | -
31 |
32 | [Github Pages]: https://pages.github.com/
33 | [ReMarkdown.css]: https://fvsch.com/remarkdown/
34 | [rouge]: http://rouge.jneen.net/
35 | [Markdown]: https://guides.github.com/features/mastering-markdown/
36 |
--------------------------------------------------------------------------------
/bin/mk-site:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | NAME=`cat _config.yml | grep 'name:' | cut -c 7-`
4 | DESC=`cat _config.yml | grep 'description:' | cut -c 14-`
5 | echo "Building site for $NAME"
6 |
7 | TAGS=`bin/ls-tags`
8 | echo "Tags found:\n$TAGS\n"
9 |
10 | # add tags to README
11 | echo "Adding tags to README"
12 | echo "# $NAME\n" > README.md
13 | echo "$DESC\n" >> README.md
14 | echo "## Tags\n" >> README.md
15 | echo "$TAGS" | awk '{print "- ["$1"](./tags/"$1")"}' >> README.md
16 |
17 | # add notes list to README
18 | echo "Adding notes list to README"
19 | echo "\n## Notes\n" >> README.md
20 | git ls-files '*.md' '*.markdown' | grep -v README | grep -v "tags/" | bin/mk-index >> README.md
21 |
22 | # generate notes list per tag
23 | echo "Generating notes list per tag"
24 | git rm -f 'tags/*.md'
25 | mkdir -p tags
26 | echo "$TAGS" | xargs -n1 -I{} sh -c "echo \"# {}\n\" > tags/{}.md"
27 | echo "$TAGS" | xargs -n1 -I{} sh -c "git grep --name-only 'tags: .*{}' -- '*.md' '*.markdown' | bin/mk-index >> tags/{}.md"
28 |
29 | # add README to git
30 | echo "Adding README to git"
31 | git add README.md
32 |
33 | # add tag files to git
34 | echo "Adding tag files to git"
35 | echo "$TAGS" | xargs -n1 -I{} git add tags/{}.md
36 |
37 | echo "Done"
38 |
--------------------------------------------------------------------------------
/feed.atom:
--------------------------------------------------------------------------------
1 | ---
2 | layout: null
3 | ---
4 |
5 |
6 | {{ site.name }}
7 |
8 |
9 | {{ site.github.url }}/feed.atom
10 | {{ site.time | date_to_xmlschema }}
11 |
12 | {{ site.github.owner.name or site.github.owner_name }}
13 | {{ site.github.owner.blog or site.github.owner_url }}
14 |
15 | {% for page in site.pages %}
16 | {% assign page_ext = page.name | split: "." | last | downcase %}
17 | {% if page_ext == "md" or page_ext == "markdown" %}
18 | {% if page.dir != "/tags/" and page.url != "/" %}
19 |
20 | {{ page.title | xml_escape }}
21 |
22 | {{ site.github.url }}{{ page.url | split: "." | first }}
23 | {{ page.date | date_to_xmlschema }}
24 | {{ page.content | markdownify | xml_escape }}
25 | {{ page.date | date_to_xmlschema }}
26 | {% if page.tags %}
27 | {% assign tags = page.tags | split:' ' %}
28 | {% for tag in tags %}{% endfor %}
29 | {% endif %}
30 |
31 | {% endif %}
32 | {% endif %}
33 | {% endfor %}
34 |
35 |
--------------------------------------------------------------------------------
/demo-note.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2019-06-05
3 | tags: documentation demo
4 | ---
5 |
6 | # Precis Demo
7 |
8 | It's very easy to make some words **bold** and other words *italic* with Markdown. You can even [link to Google!](http://google.com).
9 |
10 | # This is an
tag
11 | ## This is an
tag
12 | ###### This is an
tag
13 |
14 | *This text will be italic*
15 | _This will also be italic_
16 |
17 | **This text will be bold**
18 | __This will also be bold__
19 |
20 | _You **can** combine them_
21 |
22 | * Item 1
23 | * Item 2
24 | * Item 2a
25 | * Item 2b
26 |
27 | 1. Item 1
28 | 1. Item 2
29 | 1. Item 3
30 | 1. Item 3a
31 | 1. Item 3b
32 |
33 | As Kanye West said:
34 |
35 | > We're living the future so
36 | > the present is our past.
37 |
38 | I think you should use an `` element here instead.
39 |
40 | And this is a horizontal rule.
41 |
42 | -----------------------
43 |
44 | ## Code
45 |
46 | There are many different ways to style code with GitHub's markdown. If you have inline code blocks, wrap them in backticks: `var example = true`. You can also add a block of code:
47 |
48 | ```javascript
49 | function fancyAlert(arg) {
50 | if(arg) {
51 | $.facebox({div:'#foo'})
52 | }
53 | }
54 | ```
55 |
56 | ## Task Lists
57 |
58 | - [x] @mentions, #refs, [links](), **formatting**, and tags supported
59 | - [x] list syntax required (any unordered or ordered list supported)
60 | - [x] this is a complete item
61 | - [ ] this is an incomplete item
62 |
63 | ## Tables
64 |
65 | You can create tables by assembling a list of words and dividing them with hyphens `-` (for the first row), and then separating each column with a pipe `|:`
66 |
67 | First Header | Second Header
68 | ------------ | -------------
69 | Content from cell 1 | Content from cell 2
70 | Content in the first column | Content in the second column
71 |
72 | You can see the [Markdown source](https://raw.githubusercontent.com/abhin4v/precis/master/demo-note.md) of this note too.
--------------------------------------------------------------------------------
/setup.markdown:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2019-06-06
3 | tags: documentation
4 | ---
5 |
6 | # Precis Setup
7 |
8 | ## Requirements
9 |
10 | Precis has no dependencies other than *git* and these basic *nix commands:
11 |
12 | - awk
13 | - cat
14 | - cut
15 | - echo
16 | - grep
17 | - sed
18 | - sh
19 | - sort
20 | - tr
21 | - xargs
22 |
23 | Most of these commands are installed by default. Otherwise, please install them using your operating system's package manager.
24 |
25 | ## Installation
26 |
27 | - Fork or clone [this repo](https://github.com/abhin4v/precis) from Github.
28 | - Delete all the markdown files:
29 |
30 | ```shell
31 | $ rm *.md *.markdown tags/*.md
32 | ```
33 |
34 | - Push to your own repo on Github.
35 | - Enable Github pages for your repo in the repo settings with _master branch_ as the source.
36 |
37 | ## Usage
38 |
39 | - Add a git pre commit hook with the following command:
40 |
41 | ```shell
42 | bin/mk-site
43 | ```
44 |
45 | - Modify `_config.yml` file with correct values as per your setup:
46 |
47 | ```yaml
48 | # the name for your notes website
49 | name: Precis
50 |
51 | # the description of the notes website
52 | description: Precis is a minimal note taking web-app built over Github Pages.
53 | ```
54 |
55 | - Write notes in Markdown in the root directory of your repo. Upon committing the files in git, home page and tag pages will be auto-generated.
56 | - Push to Github and wait for few minutes for the notes to be published.
57 |
58 | ## Notes Format
59 |
60 | You can use [Github flavoured Markdown] to write your notes. You can add date and tags to the notes using the Markdown front-matter format.
61 |
62 | A sample note:
63 |
64 | ```markdown
65 | ---
66 | date: 2019-06-06
67 | tags: meeting office
68 | ---
69 |
70 | # Meetings Notes
71 |
72 | - need to do things
73 | - need to do more things
74 | ```
75 |
76 | See [this demo note](./demo-note) to get a look and feel.
77 |
78 | [Github flavoured Markdown]: https://guides.github.com/features/mastering-markdown/
79 |
--------------------------------------------------------------------------------
/_layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {% if page.path != 'README.md' %}{{ page.title }} | {% endif %}{{ site.name }}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |