├── .gitignore ├── LICENSE ├── README.md ├── _config.yml ├── _layouts └── default.html ├── assets └── css │ └── style.scss ├── bin ├── ls-tags ├── mk-index └── mk-site ├── demo-note.md ├── feed.atom ├── introduction.md ├── setup.markdown ├── sitemap.xml └── tags ├── demo.md └── documentation.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /_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. -------------------------------------------------------------------------------- /_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 |
22 |
23 | {{ site.name }} 24 |
25 | 26 | 27 |
28 |
29 |
30 | {% if page.date %}{{ page.date }}{% endif %} 31 | {% if page.tags %} 32 | {% assign tags = page.tags | split:' ' %} 33 | 38 | {% endif %} 39 | {% if page.date %} 40 | Edit 41 | {% endif %} 42 |
43 |
44 | {{ content }} 45 |
46 | 47 |
48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /assets/css/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | body.remarkdown { 5 | font-family: Inconsolata, Menlo, Monaco, "DejaVu Sans Mono", Consolas, monospace; 6 | font-size: 18px; 7 | background: var(--body-bg-color); 8 | color: var(--text-color); 9 | min-width: 380px; 10 | 11 | ::before, ::after { 12 | opacity: .6; 13 | color: var(--md-deco-color); 14 | } 15 | 16 | .container { 17 | max-width: 700px; 18 | padding: 10px; 19 | margin: auto; 20 | background: var(--bg-color); 21 | border: 1px solid var(--border-color); 22 | @media (min-width: 300px) { 23 | padding: 20px 20px; 24 | } 25 | @media (min-width: 700px) { 26 | padding: 40px 80px; 27 | } 28 | } 29 | 30 | main > p > img { 31 | width: 100%; 32 | } 33 | 34 | h1 { 35 | font-weight: bold; 36 | font-size: larger; 37 | text-transform: capitalize; 38 | } 39 | h2 { 40 | font-weight: bold; 41 | &::before { 42 | color: #aaa; 43 | } 44 | } 45 | p code { 46 | color: var(--code-color); 47 | } 48 | a { 49 | color: var(--link-color); 50 | text-decoration: none; 51 | code { 52 | color: inherit; 53 | } 54 | &:active, &:focus { 55 | color: var(--bg-color); 56 | background-color: var(--link-color); 57 | } 58 | &:hover { 59 | border-bottom: 1px solid; 60 | } 61 | } 62 | em { 63 | font-style: italic; 64 | } 65 | strong { 66 | font-weight: bold; 67 | } 68 | ul { 69 | margin-left: 2ch; 70 | > li::before { 71 | margin-left: -2ch; 72 | } 73 | &.tags { 74 | display: inline; 75 | margin: initial; 76 | li { 77 | display: inline; 78 | list-style: none; 79 | background-color: var(--tag-bg-color); 80 | padding: 0.2em 0.3em; 81 | &::before { 82 | content: ''; 83 | } 84 | a { 85 | color: var(--tag-color); 86 | &::after, &::before { 87 | content: ''; 88 | } 89 | } 90 | } 91 | } 92 | &.task-list li.task-list-item { 93 | &::before { 94 | content: ''; 95 | float: none; 96 | margin-left: -3.5ch; 97 | } 98 | input.task-list-item-checkbox { 99 | margin-right: 1ch; 100 | } 101 | } 102 | } 103 | li em + a { 104 | display: inline-block; 105 | border-bottom: 1px solid transparent; 106 | } 107 | time { 108 | color: var(--time-color); 109 | } 110 | article time { 111 | display: block; 112 | text-align: right; 113 | } 114 | input[type="search"] { 115 | border: 1px solid var(--input-border-color); 116 | background-color: var(--input-bg-color); 117 | color: var(--input-color); 118 | font-family: inherit; 119 | font-size: smaller; 120 | padding: 0.2em; 121 | min-width: 150px; 122 | max-width: 350px; 123 | &:focus { 124 | border: 1px solid var(--link-color); 125 | width: calc(80vw - 200px); 126 | } 127 | } 128 | footer { 129 | font-size: smaller; 130 | } 131 | pre { 132 | overflow: auto; 133 | margin-left: 0ch; 134 | 135 | code { 136 | @media (max-width: 450px) { 137 | font-size: 0.9em; 138 | } 139 | } 140 | } 141 | } 142 | 143 | .highlight { 144 | pre { 145 | padding: 6px 10px; 146 | } 147 | .hll { 148 | padding: 6px 10px; 149 | } 150 | } 151 | 152 | :root { 153 | color-scheme: light dark; /* both supported */ 154 | } 155 | 156 | @media(prefers-color-scheme: no-preference), (prefers-color-scheme: light) { 157 | :root { 158 | --link-color: #a0f; 159 | --bg-color: #fdfdfd; 160 | --body-bg-color: #eee; 161 | --text-color: #333; 162 | --md-deco-color: #205080; 163 | --border-color: #ddd; 164 | --code-color: #999; 165 | --tag-color: #fdfdfd; 166 | --tag-bg-color: #c6f; 167 | --time-color: #aaa; 168 | --input-color: #333; 169 | --input-bg-color: #fdfdfd; 170 | --input-border-color: #777; 171 | } 172 | 173 | .highlight { 174 | pre { 175 | background-color: #f8f8f8; 176 | } 177 | .hll { 178 | background-color: #f8f8f8; 179 | } 180 | .c { 181 | color: #999988; 182 | font-style: italic; 183 | } 184 | .err { 185 | color: #a61717; 186 | background-color: #e3d2d2; 187 | } 188 | .k, .o { 189 | font-weight: bold; 190 | } 191 | .cm { 192 | color: #999988; 193 | font-style: italic; 194 | } 195 | .cp { 196 | color: #999999; 197 | font-weight: bold; 198 | } 199 | .c1 { 200 | color: #999988; 201 | font-style: italic; 202 | } 203 | .cs { 204 | color: #999999; 205 | font-weight: bold; 206 | font-style: italic; 207 | } 208 | .gd { 209 | color: #000000; 210 | background-color: #ffdddd; 211 | .x { 212 | color: #000000; 213 | background-color: #ffaaaa; 214 | } 215 | } 216 | .ge { 217 | font-style: italic; 218 | } 219 | .gr { 220 | color: #aa0000; 221 | } 222 | .gh { 223 | color: #999999; 224 | } 225 | .gi { 226 | color: #000000; 227 | background-color: #ddffdd; 228 | .x { 229 | color: #000000; 230 | background-color: #aaffaa; 231 | } 232 | } 233 | .go { 234 | color: #888888; 235 | } 236 | .gp { 237 | color: #555555; 238 | } 239 | .gs { 240 | font-weight: bold; 241 | } 242 | .gu { 243 | color: #800080; 244 | font-weight: bold; 245 | } 246 | .gt { 247 | color: #aa0000; 248 | } 249 | .kc, .kd, .kn, .kp, .kr { 250 | font-weight: bold; 251 | } 252 | .kt { 253 | color: #445588; 254 | font-weight: bold; 255 | } 256 | .m { 257 | color: #009999; 258 | } 259 | .s { 260 | color: #dd1144; 261 | } 262 | .n { 263 | color: #333333; 264 | } 265 | .na { 266 | color: teal; 267 | } 268 | .nb { 269 | color: #0086b3; 270 | } 271 | .nc { 272 | color: #445588; 273 | font-weight: bold; 274 | } 275 | .no { 276 | color: teal; 277 | } 278 | .ni { 279 | color: purple; 280 | } 281 | .ne, .nf { 282 | color: #990000; 283 | font-weight: bold; 284 | } 285 | .nn { 286 | color: #555555; 287 | } 288 | .nt { 289 | color: navy; 290 | } 291 | .nv { 292 | color: teal; 293 | } 294 | .ow { 295 | font-weight: bold; 296 | } 297 | .w { 298 | color: #bbbbbb; 299 | } 300 | .mf, .mh, .mi, .mo { 301 | color: #009999; 302 | } 303 | .sb, .sc, .sd, .s2, .se, .sh, .si, .sx { 304 | color: #dd1144; 305 | } 306 | .sr { 307 | color: #009926; 308 | } 309 | .s1 { 310 | color: #dd1144; 311 | } 312 | .ss { 313 | color: #990073; 314 | } 315 | .bp { 316 | color: #999999; 317 | } 318 | .vc, .vg, .vi { 319 | color: teal; 320 | } 321 | .il { 322 | color: #009999; 323 | } 324 | .gc { 325 | color: #999; 326 | background-color: #EAF2F5; 327 | } 328 | } 329 | } 330 | 331 | @media (prefers-color-scheme: dark) { 332 | :root { 333 | --link-color: #d073ff; 334 | --bg-color: #292929; 335 | --body-bg-color: #1b1b1b; 336 | --text-color: #d6d6d6; 337 | --md-deco-color: #fbe36e; 338 | --border-color: #222222; 339 | --code-color: #828282; 340 | --tag-color: #fdfdfd; 341 | --tag-bg-color: #8f00d6; 342 | --time-color: #555555; 343 | --input-color: #cccccc; 344 | --input-bg-color: #0f0f0f; 345 | --input-border-color: #888888; 346 | } 347 | 348 | body img { 349 | filter: brightness(.8) contrast(1.2); 350 | &[src$=".svg"] { 351 | filter: invert(90%); 352 | } 353 | } 354 | 355 | .highlight { 356 | pre { 357 | color: #fbf1c7; 358 | background-color: #242424; 359 | } 360 | .w { 361 | color: #fbf1c7; 362 | background-color: #282828; 363 | } 364 | .err { 365 | color: #fb4934; 366 | background-color: #282828; 367 | font-weight: bold; 368 | } 369 | .c, .cd, .cm, .c1, .cs { 370 | color: #928374; 371 | font-style: italic; 372 | } 373 | .cp { 374 | color: #8ec07c; 375 | } 376 | .nt { 377 | color: #fb4934; 378 | } 379 | .o, .ow, .p, .pi { 380 | color: #fbf1c7; 381 | } 382 | .gi { 383 | color: #b8bb26; 384 | background-color: #282828; 385 | } 386 | .gd { 387 | color: #fb4934; 388 | background-color: #282828; 389 | } 390 | .gh { 391 | color: #b8bb26; 392 | font-weight: bold; 393 | } 394 | .k, .kn, .kp, .kr, .kv { 395 | color: #fb4934; 396 | } 397 | .kc { 398 | color: #d3869b; 399 | } 400 | .kt { 401 | color: #fabd2f; 402 | } 403 | .kd { 404 | color: #fe8019; 405 | } 406 | .s, .sb, .sc, .sd, .s2, .sh, .sx, .s1, .si, .sr { 407 | color: #b8bb26; 408 | font-style: italic; 409 | } 410 | .se { 411 | color: #fe8019; 412 | } 413 | .nn, .nc { 414 | color: #8ec07c; 415 | } 416 | .no { 417 | color: #d3869b; 418 | } 419 | .na { 420 | color: #b8bb26; 421 | } 422 | .m, .mf, .mh, .mi, .il, .mo, .mb, .mx { 423 | color: #d3869b; 424 | } 425 | .ss { 426 | color: #83a598; 427 | } 428 | } 429 | } 430 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tags/demo.md: -------------------------------------------------------------------------------- 1 | # demo 2 | 3 | - *2019-06-05* [demo-note](./demo-note) 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 | --------------------------------------------------------------------------------