From a8959e23f52f46852855f58eae2061ada25da47c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Silva?= Date: Thu, 3 Dec 2020 23:20:25 +0000 Subject: [PATCH] feat: more docs --- docs/api.html | 75 ++ docs/index.html | 103 +-- docs/static/style.css | 805 ++++++++++++++++++++++ notadocs/.nota/list.nota | Bin 185 -> 349 bytes notadocs/.nota/templates/nota.html | 23 + notadocs/.nota/templates/static/style.css | 805 ++++++++++++++++++++++ notadocs/api.md | 34 + notadocs/index.md | 51 +- src/exporter/exporter.rs | 62 +- src/exporter/templates.rs | 12 +- src/lib.rs | 4 +- 11 files changed, 1850 insertions(+), 124 deletions(-) create mode 100644 docs/api.html create mode 100644 docs/static/style.css create mode 100644 notadocs/.nota/templates/nota.html create mode 100644 notadocs/.nota/templates/static/style.css create mode 100644 notadocs/api.md diff --git a/docs/api.html b/docs/api.html new file mode 100644 index 0000000..b11e27b --- /dev/null +++ b/docs/api.html @@ -0,0 +1,75 @@ + + + + +App + + + + +
+

Last Update: Thu, 03 Dec 2020 23:17:24 +0000

+

Back to index 🏠

+
+
+

NOTA API

+
TODO: Still not stable
+
+ + + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index e045477..5895df2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,96 +1,43 @@ - - App - - - + +App + + -
- -
-

NOTA Docs

+
+

Last Update: Thu, 03 Dec 2020 23:18:24 +0000

+

Back to index 🏠

+
+
+

NOTA Docs

NOTA is a simple note taker tool that helps you organize your notes.

-

Why Another tool ? Aren't there enough already ?

+

Why Another tool ? Aren't there enough already ?

Yeah, there are and that is part of the problem NOTA aims to fix. -I wanted to write my notes like I like to write my code: with no predefined +I would like to write my notes like I like to write my code: with no predefined editor, only tooling around the language. -I wanted to be this way for my notes too, I wanted to be able to edit and take -notes with any editor I wanted. No app lock in's no enforced programs or shaddy -web apps to use to do the things I wanted.

+No app lock in's, no enforced programs or shaddy web apps to use to do the things I wanted.

Simple text files, with a litle bit of tooling around for the extra producivity

Very early state in the project, not ready in any way shape or form xD

-

Features

+

Features

-

Install

- -

API

- +

Install

+
ToDo
+
+

API

+

API Page

-
- ⬅️ Back to index - To the top ⬆️ -
-
+ \ No newline at end of file diff --git a/docs/static/style.css b/docs/static/style.css new file mode 100644 index 0000000..9e1642b --- /dev/null +++ b/docs/static/style.css @@ -0,0 +1,805 @@ +/** + * Forced light theme version + */ + +:root { + --background-body: #fff; + --background: #efefef; + --background-alt: #f7f7f7; + --selection: #9e9e9e; + --text-main: #363636; + --text-bright: #000; + --text-muted: #70777f; + --links: #0076d1; + --focus: #0096bfab; + --border: #dbdbdb; + --code: #000; + --animation-duration: 0.1s; + --button-hover: #ddd; + --scrollbar-thumb: rgb(213, 213, 213); + --scrollbar-thumb-hover: rgb(196, 196, 196); + --form-placeholder: #949494; + --form-text: #000; + --variable: #39a33c; + --highlight: #ff0; + --select-arrow: url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='62.5' width='116.9' fill='%23161f27'%3E %3Cpath d='M115.3,1.6 C113.7,0 111.1,0 109.5,1.6 L58.5,52.7 L7.4,1.6 C5.8,0 3.2,0 1.6,1.6 C0,3.2 0,5.8 1.6,7.4 L55.5,61.3 C56.3,62.1 57.3,62.5 58.4,62.5 C59.4,62.5 60.5,62.1 61.3,61.3 L115.2,7.4 C116.9,5.8 116.9,3.2 115.3,1.6Z'/%3E %3C/svg%3E"); +} + +html { + scrollbar-color: rgb(213, 213, 213) #fff; + scrollbar-color: var(--scrollbar-thumb) var(--background-body); + scrollbar-width: thin; +} + +body { + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; + line-height: 1.4; + max-width: 800px; + margin: 20px auto; + padding: 0 10px; + word-wrap: break-word; + color: #363636; + color: var(--text-main); + background: #fff; + background: var(--background-body); + text-rendering: optimizeLegibility; +} + +button { + transition: + background-color 0.1s linear, + border-color 0.1s linear, + color 0.1s linear, + box-shadow 0.1s linear, + transform 0.1s ease; + transition: + background-color var(--animation-duration) linear, + border-color var(--animation-duration) linear, + color var(--animation-duration) linear, + box-shadow var(--animation-duration) linear, + transform var(--animation-duration) ease; +} + +input { + transition: + background-color 0.1s linear, + border-color 0.1s linear, + color 0.1s linear, + box-shadow 0.1s linear, + transform 0.1s ease; + transition: + background-color var(--animation-duration) linear, + border-color var(--animation-duration) linear, + color var(--animation-duration) linear, + box-shadow var(--animation-duration) linear, + transform var(--animation-duration) ease; +} + +textarea { + transition: + background-color 0.1s linear, + border-color 0.1s linear, + color 0.1s linear, + box-shadow 0.1s linear, + transform 0.1s ease; + transition: + background-color var(--animation-duration) linear, + border-color var(--animation-duration) linear, + color var(--animation-duration) linear, + box-shadow var(--animation-duration) linear, + transform var(--animation-duration) ease; +} + +h1 { + font-size: 2.2em; + margin-top: 0; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + margin-bottom: 6px; + margin-top: 12px; +} + +h1 { + color: #000; + color: var(--text-bright); +} + +h2 { + color: #000; + color: var(--text-bright); +} + +h3 { + color: #000; + color: var(--text-bright); +} + +h4 { + color: #000; + color: var(--text-bright); +} + +h5 { + color: #000; + color: var(--text-bright); +} + +h6 { + color: #000; + color: var(--text-bright); +} + +strong { + color: #000; + color: var(--text-bright); +} + +h1, +h2, +h3, +h4, +h5, +h6, +b, +strong, +th { + font-weight: 600; +} + +q::before { + content: none; +} + +q::after { + content: none; +} + +blockquote { + border-left: 4px solid #0096bfab; + border-left: 4px solid var(--focus); + margin: 1.5em 0; + padding: 0.5em 1em; + font-style: italic; +} + +q { + border-left: 4px solid #0096bfab; + border-left: 4px solid var(--focus); + margin: 1.5em 0; + padding: 0.5em 1em; + font-style: italic; +} + +blockquote > footer { + font-style: normal; + border: 0; +} + +blockquote cite { + font-style: normal; +} + +address { + font-style: normal; +} + +a[href^='mailto\:']::before { + content: '📧 '; +} + +a[href^='tel\:']::before { + content: '📞 '; +} + +a[href^='sms\:']::before { + content: '💬 '; +} + +mark { + background-color: #ff0; + background-color: var(--highlight); + border-radius: 2px; + padding: 0 2px 0 2px; + color: #000; +} + +button, +select, +input[type='submit'], +input[type='button'], +input[type='checkbox'], +input[type='range'], +input[type='radio'] { + cursor: pointer; +} + +input:not([type='checkbox']):not([type='radio']), +select { + display: block; +} + +input { + color: #000; + color: var(--form-text); + background-color: #efefef; + background-color: var(--background); + font-family: inherit; + font-size: inherit; + margin-right: 6px; + margin-bottom: 6px; + padding: 10px; + border: none; + border-radius: 6px; + outline: none; +} + +button { + color: #000; + color: var(--form-text); + background-color: #efefef; + background-color: var(--background); + font-family: inherit; + font-size: inherit; + margin-right: 6px; + margin-bottom: 6px; + padding: 10px; + border: none; + border-radius: 6px; + outline: none; +} + +textarea { + color: #000; + color: var(--form-text); + background-color: #efefef; + background-color: var(--background); + font-family: inherit; + font-size: inherit; + margin-right: 6px; + margin-bottom: 6px; + padding: 10px; + border: none; + border-radius: 6px; + outline: none; +} + +select { + color: #000; + color: var(--form-text); + background-color: #efefef; + background-color: var(--background); + font-family: inherit; + font-size: inherit; + margin-right: 6px; + margin-bottom: 6px; + padding: 10px; + border: none; + border-radius: 6px; + outline: none; +} + +input[type='checkbox'], +input[type='radio'] { + height: 1em; + width: 1em; +} + +input[type='radio'] { + border-radius: 100%; +} + +input { + vertical-align: top; +} + +label { + vertical-align: middle; + margin-bottom: 4px; + display: inline-block; +} + +input:not([type='checkbox']):not([type='radio']), +input[type='range'], +select, +button, +textarea { + -webkit-appearance: none; +} + +textarea { + display: block; + margin-right: 0; + box-sizing: border-box; + resize: vertical; +} + +textarea:not([cols]) { + width: 100%; +} + +textarea:not([rows]) { + min-height: 40px; + height: 140px; +} + +select { + background: #efefef url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='62.5' width='116.9' fill='%23161f27'%3E %3Cpath d='M115.3,1.6 C113.7,0 111.1,0 109.5,1.6 L58.5,52.7 L7.4,1.6 C5.8,0 3.2,0 1.6,1.6 C0,3.2 0,5.8 1.6,7.4 L55.5,61.3 C56.3,62.1 57.3,62.5 58.4,62.5 C59.4,62.5 60.5,62.1 61.3,61.3 L115.2,7.4 C116.9,5.8 116.9,3.2 115.3,1.6Z'/%3E %3C/svg%3E") calc(100% - 12px) 50% / 12px no-repeat; + background: var(--background) var(--select-arrow) calc(100% - 12px) 50% / 12px no-repeat; + padding-right: 35px; +} + +select::-ms-expand { + display: none; +} + +select[multiple] { + padding-right: 10px; + background-image: none; + overflow-y: auto; +} + +button, +input[type='submit'], +input[type='button'] { + padding-right: 30px; + padding-left: 30px; +} + +button:hover { + background: #ddd; + background: var(--button-hover); +} + +input[type='submit']:hover { + background: #ddd; + background: var(--button-hover); +} + +input[type='button']:hover { + background: #ddd; + background: var(--button-hover); +} + +input:focus { + box-shadow: 0 0 0 2px #0096bfab; + box-shadow: 0 0 0 2px var(--focus); +} + +select:focus { + box-shadow: 0 0 0 2px #0096bfab; + box-shadow: 0 0 0 2px var(--focus); +} + +button:focus { + box-shadow: 0 0 0 2px #0096bfab; + box-shadow: 0 0 0 2px var(--focus); +} + +textarea:focus { + box-shadow: 0 0 0 2px #0096bfab; + box-shadow: 0 0 0 2px var(--focus); +} + +input[type='checkbox']:active, +input[type='radio']:active, +input[type='submit']:active, +input[type='button']:active, +input[type='range']:active, +button:active { + transform: translateY(2px); +} + +input:disabled, +select:disabled, +button:disabled, +textarea:disabled { + cursor: not-allowed; + opacity: 0.5; +} + +::-moz-placeholder { + color: #949494; + color: var(--form-placeholder); +} + +:-ms-input-placeholder { + color: #949494; + color: var(--form-placeholder); +} + +::-ms-input-placeholder { + color: #949494; + color: var(--form-placeholder); +} + +::placeholder { + color: #949494; + color: var(--form-placeholder); +} + +fieldset { + border: 1px #0096bfab solid; + border: 1px var(--focus) solid; + border-radius: 6px; + margin: 0; + margin-bottom: 12px; + padding: 10px; +} + +legend { + font-size: 0.9em; + font-weight: 600; +} + +input[type='range'] { + margin: 10px 0; + padding: 10px 0; + background: transparent; +} + +input[type='range']:focus { + outline: none; +} + +input[type='range']::-webkit-slider-runnable-track { + width: 100%; + height: 9.5px; + -webkit-transition: 0.2s; + transition: 0.2s; + background: #efefef; + background: var(--background); + border-radius: 3px; +} + +input[type='range']::-webkit-slider-thumb { + box-shadow: 0 1px 1px #000, 0 0 1px #0d0d0d; + height: 20px; + width: 20px; + border-radius: 50%; + background: #dbdbdb; + background: var(--border); + -webkit-appearance: none; + margin-top: -7px; +} + +input[type='range']:focus::-webkit-slider-runnable-track { + background: #efefef; + background: var(--background); +} + +input[type='range']::-moz-range-track { + width: 100%; + height: 9.5px; + -moz-transition: 0.2s; + transition: 0.2s; + background: #efefef; + background: var(--background); + border-radius: 3px; +} + +input[type='range']::-moz-range-thumb { + box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d; + height: 20px; + width: 20px; + border-radius: 50%; + background: #dbdbdb; + background: var(--border); +} + +input[type='range']::-ms-track { + width: 100%; + height: 9.5px; + background: transparent; + border-color: transparent; + border-width: 16px 0; + color: transparent; +} + +input[type='range']::-ms-fill-lower { + background: #efefef; + background: var(--background); + border: 0.2px solid #010101; + border-radius: 3px; + box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d; +} + +input[type='range']::-ms-fill-upper { + background: #efefef; + background: var(--background); + border: 0.2px solid #010101; + border-radius: 3px; + box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d; +} + +input[type='range']::-ms-thumb { + box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d; + border: 1px solid #000; + height: 20px; + width: 20px; + border-radius: 50%; + background: #dbdbdb; + background: var(--border); +} + +input[type='range']:focus::-ms-fill-lower { + background: #efefef; + background: var(--background); +} + +input[type='range']:focus::-ms-fill-upper { + background: #efefef; + background: var(--background); +} + +a { + text-decoration: none; + color: #0076d1; + color: var(--links); +} + +a:hover { + text-decoration: underline; +} + +code { + background: #efefef; + background: var(--background); + color: #000; + color: var(--code); + padding: 2.5px 5px; + border-radius: 6px; + font-size: 1em; +} + +samp { + background: #efefef; + background: var(--background); + color: #000; + color: var(--code); + padding: 2.5px 5px; + border-radius: 6px; + font-size: 1em; +} + +time { + background: #efefef; + background: var(--background); + color: #000; + color: var(--code); + padding: 2.5px 5px; + border-radius: 6px; + font-size: 1em; +} + +pre > code { + padding: 10px; + display: block; + overflow-x: auto; +} + +var { + color: #39a33c; + color: var(--variable); + font-style: normal; + font-family: monospace; +} + +kbd { + background: #efefef; + background: var(--background); + border: 1px solid #dbdbdb; + border: 1px solid var(--border); + border-radius: 2px; + color: #363636; + color: var(--text-main); + padding: 2px 4px 2px 4px; +} + +img, +video { + max-width: 100%; + height: auto; +} + +hr { + border: none; + border-top: 1px solid #dbdbdb; + border-top: 1px solid var(--border); +} + +table { + border-collapse: collapse; + margin-bottom: 10px; + width: 100%; + table-layout: fixed; +} + +table caption { + text-align: left; +} + +td, +th { + padding: 6px; + text-align: left; + vertical-align: top; + word-wrap: break-word; +} + +thead { + border-bottom: 1px solid #dbdbdb; + border-bottom: 1px solid var(--border); +} + +tfoot { + border-top: 1px solid #dbdbdb; + border-top: 1px solid var(--border); +} + +tbody tr:nth-child(even) { + background-color: #f7f7f7; + background-color: var(--background-alt); +} + +::-webkit-scrollbar { + height: 10px; + width: 10px; +} + +::-webkit-scrollbar-track { + background: #efefef; + background: var(--background); + border-radius: 6px; +} + +::-webkit-scrollbar-thumb { + background: rgb(213, 213, 213); + background: var(--scrollbar-thumb); + border-radius: 6px; +} + +::-webkit-scrollbar-thumb:hover { + background: rgb(196, 196, 196); + background: var(--scrollbar-thumb-hover); +} + +::-moz-selection { + background-color: #9e9e9e; + background-color: var(--selection); + color: #000; + color: var(--text-bright); +} + +::selection { + background-color: #9e9e9e; + background-color: var(--selection); + color: #000; + color: var(--text-bright); +} + +details { + display: flex; + flex-direction: column; + align-items: flex-start; + background-color: #f7f7f7; + background-color: var(--background-alt); + padding: 10px 10px 0; + margin: 1em 0; + border-radius: 6px; + overflow: hidden; +} + +details[open] { + padding: 10px; +} + +details > :last-child { + margin-bottom: 0; +} + +details[open] summary { + margin-bottom: 10px; +} + +summary { + display: list-item; + background-color: #efefef; + background-color: var(--background); + padding: 10px; + margin: -10px -10px 0; + cursor: pointer; + outline: none; +} + +summary:hover, +summary:focus { + text-decoration: underline; +} + +details > :not(summary) { + margin-top: 0; +} + +summary::-webkit-details-marker { + color: #363636; + color: var(--text-main); +} + +footer { + border-top: 1px solid #dbdbdb; + border-top: 1px solid var(--border); + padding-top: 10px; + color: #70777f; + color: var(--text-muted); +} + +body > footer { + margin-top: 40px; +} + +@media print { + body, + pre, + code, + summary, + details, + button, + input, + textarea { + background-color: #fff; + } + + button, + input, + textarea { + border: 1px solid #000; + } + + body, + h1, + h2, + h3, + h4, + h5, + h6, + pre, + code, + button, + input, + textarea, + footer, + summary, + strong { + color: #000; + } + + summary::marker { + color: #000; + } + + summary::-webkit-details-marker { + color: #000; + } + + tbody tr:nth-child(even) { + background-color: #f2f2f2; + } + + a { + color: #00f; + text-decoration: underline; + } +} + +.row { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; +} \ No newline at end of file diff --git a/notadocs/.nota/list.nota b/notadocs/.nota/list.nota index 69e5cb2eaf3a66777e5474993679c858dc93c9f9..d4e55ca204d37e86bc55357fd2f49520ea46c3af 100644 GIT binary patch delta 119 zcmdnVc$bNhX(HneDMkheVB~-@{QN^46&wRRttRSP`zID;>gA?5K&6aa4P1@gjGRo& z9i2^#-JBdPoQ+M)94!sZ&5TXloE^ + + + +App + + + + +
+

Last Update: {{lastmodified}}

+

Back to index 🏠

+
+
+{{{body}}} + + + \ No newline at end of file diff --git a/notadocs/.nota/templates/static/style.css b/notadocs/.nota/templates/static/style.css new file mode 100644 index 0000000..9e1642b --- /dev/null +++ b/notadocs/.nota/templates/static/style.css @@ -0,0 +1,805 @@ +/** + * Forced light theme version + */ + +:root { + --background-body: #fff; + --background: #efefef; + --background-alt: #f7f7f7; + --selection: #9e9e9e; + --text-main: #363636; + --text-bright: #000; + --text-muted: #70777f; + --links: #0076d1; + --focus: #0096bfab; + --border: #dbdbdb; + --code: #000; + --animation-duration: 0.1s; + --button-hover: #ddd; + --scrollbar-thumb: rgb(213, 213, 213); + --scrollbar-thumb-hover: rgb(196, 196, 196); + --form-placeholder: #949494; + --form-text: #000; + --variable: #39a33c; + --highlight: #ff0; + --select-arrow: url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='62.5' width='116.9' fill='%23161f27'%3E %3Cpath d='M115.3,1.6 C113.7,0 111.1,0 109.5,1.6 L58.5,52.7 L7.4,1.6 C5.8,0 3.2,0 1.6,1.6 C0,3.2 0,5.8 1.6,7.4 L55.5,61.3 C56.3,62.1 57.3,62.5 58.4,62.5 C59.4,62.5 60.5,62.1 61.3,61.3 L115.2,7.4 C116.9,5.8 116.9,3.2 115.3,1.6Z'/%3E %3C/svg%3E"); +} + +html { + scrollbar-color: rgb(213, 213, 213) #fff; + scrollbar-color: var(--scrollbar-thumb) var(--background-body); + scrollbar-width: thin; +} + +body { + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; + line-height: 1.4; + max-width: 800px; + margin: 20px auto; + padding: 0 10px; + word-wrap: break-word; + color: #363636; + color: var(--text-main); + background: #fff; + background: var(--background-body); + text-rendering: optimizeLegibility; +} + +button { + transition: + background-color 0.1s linear, + border-color 0.1s linear, + color 0.1s linear, + box-shadow 0.1s linear, + transform 0.1s ease; + transition: + background-color var(--animation-duration) linear, + border-color var(--animation-duration) linear, + color var(--animation-duration) linear, + box-shadow var(--animation-duration) linear, + transform var(--animation-duration) ease; +} + +input { + transition: + background-color 0.1s linear, + border-color 0.1s linear, + color 0.1s linear, + box-shadow 0.1s linear, + transform 0.1s ease; + transition: + background-color var(--animation-duration) linear, + border-color var(--animation-duration) linear, + color var(--animation-duration) linear, + box-shadow var(--animation-duration) linear, + transform var(--animation-duration) ease; +} + +textarea { + transition: + background-color 0.1s linear, + border-color 0.1s linear, + color 0.1s linear, + box-shadow 0.1s linear, + transform 0.1s ease; + transition: + background-color var(--animation-duration) linear, + border-color var(--animation-duration) linear, + color var(--animation-duration) linear, + box-shadow var(--animation-duration) linear, + transform var(--animation-duration) ease; +} + +h1 { + font-size: 2.2em; + margin-top: 0; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + margin-bottom: 6px; + margin-top: 12px; +} + +h1 { + color: #000; + color: var(--text-bright); +} + +h2 { + color: #000; + color: var(--text-bright); +} + +h3 { + color: #000; + color: var(--text-bright); +} + +h4 { + color: #000; + color: var(--text-bright); +} + +h5 { + color: #000; + color: var(--text-bright); +} + +h6 { + color: #000; + color: var(--text-bright); +} + +strong { + color: #000; + color: var(--text-bright); +} + +h1, +h2, +h3, +h4, +h5, +h6, +b, +strong, +th { + font-weight: 600; +} + +q::before { + content: none; +} + +q::after { + content: none; +} + +blockquote { + border-left: 4px solid #0096bfab; + border-left: 4px solid var(--focus); + margin: 1.5em 0; + padding: 0.5em 1em; + font-style: italic; +} + +q { + border-left: 4px solid #0096bfab; + border-left: 4px solid var(--focus); + margin: 1.5em 0; + padding: 0.5em 1em; + font-style: italic; +} + +blockquote > footer { + font-style: normal; + border: 0; +} + +blockquote cite { + font-style: normal; +} + +address { + font-style: normal; +} + +a[href^='mailto\:']::before { + content: '📧 '; +} + +a[href^='tel\:']::before { + content: '📞 '; +} + +a[href^='sms\:']::before { + content: '💬 '; +} + +mark { + background-color: #ff0; + background-color: var(--highlight); + border-radius: 2px; + padding: 0 2px 0 2px; + color: #000; +} + +button, +select, +input[type='submit'], +input[type='button'], +input[type='checkbox'], +input[type='range'], +input[type='radio'] { + cursor: pointer; +} + +input:not([type='checkbox']):not([type='radio']), +select { + display: block; +} + +input { + color: #000; + color: var(--form-text); + background-color: #efefef; + background-color: var(--background); + font-family: inherit; + font-size: inherit; + margin-right: 6px; + margin-bottom: 6px; + padding: 10px; + border: none; + border-radius: 6px; + outline: none; +} + +button { + color: #000; + color: var(--form-text); + background-color: #efefef; + background-color: var(--background); + font-family: inherit; + font-size: inherit; + margin-right: 6px; + margin-bottom: 6px; + padding: 10px; + border: none; + border-radius: 6px; + outline: none; +} + +textarea { + color: #000; + color: var(--form-text); + background-color: #efefef; + background-color: var(--background); + font-family: inherit; + font-size: inherit; + margin-right: 6px; + margin-bottom: 6px; + padding: 10px; + border: none; + border-radius: 6px; + outline: none; +} + +select { + color: #000; + color: var(--form-text); + background-color: #efefef; + background-color: var(--background); + font-family: inherit; + font-size: inherit; + margin-right: 6px; + margin-bottom: 6px; + padding: 10px; + border: none; + border-radius: 6px; + outline: none; +} + +input[type='checkbox'], +input[type='radio'] { + height: 1em; + width: 1em; +} + +input[type='radio'] { + border-radius: 100%; +} + +input { + vertical-align: top; +} + +label { + vertical-align: middle; + margin-bottom: 4px; + display: inline-block; +} + +input:not([type='checkbox']):not([type='radio']), +input[type='range'], +select, +button, +textarea { + -webkit-appearance: none; +} + +textarea { + display: block; + margin-right: 0; + box-sizing: border-box; + resize: vertical; +} + +textarea:not([cols]) { + width: 100%; +} + +textarea:not([rows]) { + min-height: 40px; + height: 140px; +} + +select { + background: #efefef url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='62.5' width='116.9' fill='%23161f27'%3E %3Cpath d='M115.3,1.6 C113.7,0 111.1,0 109.5,1.6 L58.5,52.7 L7.4,1.6 C5.8,0 3.2,0 1.6,1.6 C0,3.2 0,5.8 1.6,7.4 L55.5,61.3 C56.3,62.1 57.3,62.5 58.4,62.5 C59.4,62.5 60.5,62.1 61.3,61.3 L115.2,7.4 C116.9,5.8 116.9,3.2 115.3,1.6Z'/%3E %3C/svg%3E") calc(100% - 12px) 50% / 12px no-repeat; + background: var(--background) var(--select-arrow) calc(100% - 12px) 50% / 12px no-repeat; + padding-right: 35px; +} + +select::-ms-expand { + display: none; +} + +select[multiple] { + padding-right: 10px; + background-image: none; + overflow-y: auto; +} + +button, +input[type='submit'], +input[type='button'] { + padding-right: 30px; + padding-left: 30px; +} + +button:hover { + background: #ddd; + background: var(--button-hover); +} + +input[type='submit']:hover { + background: #ddd; + background: var(--button-hover); +} + +input[type='button']:hover { + background: #ddd; + background: var(--button-hover); +} + +input:focus { + box-shadow: 0 0 0 2px #0096bfab; + box-shadow: 0 0 0 2px var(--focus); +} + +select:focus { + box-shadow: 0 0 0 2px #0096bfab; + box-shadow: 0 0 0 2px var(--focus); +} + +button:focus { + box-shadow: 0 0 0 2px #0096bfab; + box-shadow: 0 0 0 2px var(--focus); +} + +textarea:focus { + box-shadow: 0 0 0 2px #0096bfab; + box-shadow: 0 0 0 2px var(--focus); +} + +input[type='checkbox']:active, +input[type='radio']:active, +input[type='submit']:active, +input[type='button']:active, +input[type='range']:active, +button:active { + transform: translateY(2px); +} + +input:disabled, +select:disabled, +button:disabled, +textarea:disabled { + cursor: not-allowed; + opacity: 0.5; +} + +::-moz-placeholder { + color: #949494; + color: var(--form-placeholder); +} + +:-ms-input-placeholder { + color: #949494; + color: var(--form-placeholder); +} + +::-ms-input-placeholder { + color: #949494; + color: var(--form-placeholder); +} + +::placeholder { + color: #949494; + color: var(--form-placeholder); +} + +fieldset { + border: 1px #0096bfab solid; + border: 1px var(--focus) solid; + border-radius: 6px; + margin: 0; + margin-bottom: 12px; + padding: 10px; +} + +legend { + font-size: 0.9em; + font-weight: 600; +} + +input[type='range'] { + margin: 10px 0; + padding: 10px 0; + background: transparent; +} + +input[type='range']:focus { + outline: none; +} + +input[type='range']::-webkit-slider-runnable-track { + width: 100%; + height: 9.5px; + -webkit-transition: 0.2s; + transition: 0.2s; + background: #efefef; + background: var(--background); + border-radius: 3px; +} + +input[type='range']::-webkit-slider-thumb { + box-shadow: 0 1px 1px #000, 0 0 1px #0d0d0d; + height: 20px; + width: 20px; + border-radius: 50%; + background: #dbdbdb; + background: var(--border); + -webkit-appearance: none; + margin-top: -7px; +} + +input[type='range']:focus::-webkit-slider-runnable-track { + background: #efefef; + background: var(--background); +} + +input[type='range']::-moz-range-track { + width: 100%; + height: 9.5px; + -moz-transition: 0.2s; + transition: 0.2s; + background: #efefef; + background: var(--background); + border-radius: 3px; +} + +input[type='range']::-moz-range-thumb { + box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d; + height: 20px; + width: 20px; + border-radius: 50%; + background: #dbdbdb; + background: var(--border); +} + +input[type='range']::-ms-track { + width: 100%; + height: 9.5px; + background: transparent; + border-color: transparent; + border-width: 16px 0; + color: transparent; +} + +input[type='range']::-ms-fill-lower { + background: #efefef; + background: var(--background); + border: 0.2px solid #010101; + border-radius: 3px; + box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d; +} + +input[type='range']::-ms-fill-upper { + background: #efefef; + background: var(--background); + border: 0.2px solid #010101; + border-radius: 3px; + box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d; +} + +input[type='range']::-ms-thumb { + box-shadow: 1px 1px 1px #000, 0 0 1px #0d0d0d; + border: 1px solid #000; + height: 20px; + width: 20px; + border-radius: 50%; + background: #dbdbdb; + background: var(--border); +} + +input[type='range']:focus::-ms-fill-lower { + background: #efefef; + background: var(--background); +} + +input[type='range']:focus::-ms-fill-upper { + background: #efefef; + background: var(--background); +} + +a { + text-decoration: none; + color: #0076d1; + color: var(--links); +} + +a:hover { + text-decoration: underline; +} + +code { + background: #efefef; + background: var(--background); + color: #000; + color: var(--code); + padding: 2.5px 5px; + border-radius: 6px; + font-size: 1em; +} + +samp { + background: #efefef; + background: var(--background); + color: #000; + color: var(--code); + padding: 2.5px 5px; + border-radius: 6px; + font-size: 1em; +} + +time { + background: #efefef; + background: var(--background); + color: #000; + color: var(--code); + padding: 2.5px 5px; + border-radius: 6px; + font-size: 1em; +} + +pre > code { + padding: 10px; + display: block; + overflow-x: auto; +} + +var { + color: #39a33c; + color: var(--variable); + font-style: normal; + font-family: monospace; +} + +kbd { + background: #efefef; + background: var(--background); + border: 1px solid #dbdbdb; + border: 1px solid var(--border); + border-radius: 2px; + color: #363636; + color: var(--text-main); + padding: 2px 4px 2px 4px; +} + +img, +video { + max-width: 100%; + height: auto; +} + +hr { + border: none; + border-top: 1px solid #dbdbdb; + border-top: 1px solid var(--border); +} + +table { + border-collapse: collapse; + margin-bottom: 10px; + width: 100%; + table-layout: fixed; +} + +table caption { + text-align: left; +} + +td, +th { + padding: 6px; + text-align: left; + vertical-align: top; + word-wrap: break-word; +} + +thead { + border-bottom: 1px solid #dbdbdb; + border-bottom: 1px solid var(--border); +} + +tfoot { + border-top: 1px solid #dbdbdb; + border-top: 1px solid var(--border); +} + +tbody tr:nth-child(even) { + background-color: #f7f7f7; + background-color: var(--background-alt); +} + +::-webkit-scrollbar { + height: 10px; + width: 10px; +} + +::-webkit-scrollbar-track { + background: #efefef; + background: var(--background); + border-radius: 6px; +} + +::-webkit-scrollbar-thumb { + background: rgb(213, 213, 213); + background: var(--scrollbar-thumb); + border-radius: 6px; +} + +::-webkit-scrollbar-thumb:hover { + background: rgb(196, 196, 196); + background: var(--scrollbar-thumb-hover); +} + +::-moz-selection { + background-color: #9e9e9e; + background-color: var(--selection); + color: #000; + color: var(--text-bright); +} + +::selection { + background-color: #9e9e9e; + background-color: var(--selection); + color: #000; + color: var(--text-bright); +} + +details { + display: flex; + flex-direction: column; + align-items: flex-start; + background-color: #f7f7f7; + background-color: var(--background-alt); + padding: 10px 10px 0; + margin: 1em 0; + border-radius: 6px; + overflow: hidden; +} + +details[open] { + padding: 10px; +} + +details > :last-child { + margin-bottom: 0; +} + +details[open] summary { + margin-bottom: 10px; +} + +summary { + display: list-item; + background-color: #efefef; + background-color: var(--background); + padding: 10px; + margin: -10px -10px 0; + cursor: pointer; + outline: none; +} + +summary:hover, +summary:focus { + text-decoration: underline; +} + +details > :not(summary) { + margin-top: 0; +} + +summary::-webkit-details-marker { + color: #363636; + color: var(--text-main); +} + +footer { + border-top: 1px solid #dbdbdb; + border-top: 1px solid var(--border); + padding-top: 10px; + color: #70777f; + color: var(--text-muted); +} + +body > footer { + margin-top: 40px; +} + +@media print { + body, + pre, + code, + summary, + details, + button, + input, + textarea { + background-color: #fff; + } + + button, + input, + textarea { + border: 1px solid #000; + } + + body, + h1, + h2, + h3, + h4, + h5, + h6, + pre, + code, + button, + input, + textarea, + footer, + summary, + strong { + color: #000; + } + + summary::marker { + color: #000; + } + + summary::-webkit-details-marker { + color: #000; + } + + tbody tr:nth-child(even) { + background-color: #f2f2f2; + } + + a { + color: #00f; + text-decoration: underline; + } +} + +.row { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; +} \ No newline at end of file diff --git a/notadocs/api.md b/notadocs/api.md new file mode 100644 index 0000000..133de06 --- /dev/null +++ b/notadocs/api.md @@ -0,0 +1,34 @@ +# NOTA API + +``` +TODO: Still not stable +``` + +- nota init + - initializes the NOTA folders + - Status: _Buggy_ + +- nota list + - list available notas + - Status: _TODO_ + +- nota new _NAME_ + - _NAME_ is optional + - if _NAME_ is provided use it to create nota + - if not create a new one under Daily/ + - Status: _Buggy_ + +- nota add _PATH_ + - _PATH_ is required + - adds an existing markdown file to the nota folder + - storing their metadata in the nota index + - Status: _Buggy_ + +- nota update _NAME_ + - updates the NOTA by adding their metadata to the index + - Status: _TODO_ + +- nota export _NAME_ + - _NAME_ is optional + - exports the nota into the specific format, right now HTML + - Status: _Buggy_ \ No newline at end of file diff --git a/notadocs/index.md b/notadocs/index.md index 4503859..adcbf99 100644 --- a/notadocs/index.md +++ b/notadocs/index.md @@ -2,60 +2,29 @@ NOTA is a simple note taker tool that helps you organize your notes. -# Why Another tool ? Aren't there enough already ? +## Why Another tool ? Aren't there enough already ? Yeah, there are and that is part of the problem NOTA aims to fix. -I wanted to write my notes like I like to write my code: with no predefined +I would like to write my notes like I like to write my code: with no predefined editor, only tooling around the language. -I wanted to be this way for my notes too, I wanted to be able to edit and take -notes with any editor I wanted. No app lock in's no enforced programs or shaddy -web apps to use to do the things I wanted. +No app lock in's, no enforced programs or shaddy web apps to use to do the things I wanted. Simple text files, with a litle bit of tooling around for the extra producivity **Very early state in the project, not ready in any way shape or form xD** -# Features +## Features - Basic note management (create, update list, search) - Linking and Reverse Linking of notes - Export to other formats -# Install +## Install -- Download the binary -- Add it to your path -- Create a folder for your notes (optional) -- Add a Environment Variable NOTA_FOLDER that points to the folder -- You are good to go ! +``` +ToDo +``` -# API +## API -- nota init - - initializes the NOTA folders - - Status: _Buggy_ - -- nota list - - list available notas - - Status: _TODO_ - -- nota new _NAME_ - - _NAME_ is optional - - if _NAME_ is provided use it to create nota - - if not create a new one under Daily/ - - Status: _Buggy_ - -- nota add _PATH_ - - _PATH_ is required - - adds an existing markdown file to the nota folder - - storing their metadata in the nota index - - Status: _Buggy_ - -- nota update _NAME_ - - updates the NOTA by adding their metadata to the index - - Status: _TODO_ - -- nota export _NAME_ - - _NAME_ is optional - - exports the nota into the specific format, right now HTML - - Status: _Buggy_ \ No newline at end of file +[API Page](api.html) \ No newline at end of file diff --git a/src/exporter/exporter.rs b/src/exporter/exporter.rs index 5435c66..a6652ad 100644 --- a/src/exporter/exporter.rs +++ b/src/exporter/exporter.rs @@ -13,6 +13,12 @@ use std::io::Write; use std::fs::File; use walkdir::WalkDir; + +use crate::index::list::IndexEntry; +use std::time::SystemTime; +use chrono::{DateTime, TimeZone, Utc}; +use std::convert::TryInto; + // //use std::path::{ PathBuf}; // @@ -76,11 +82,65 @@ pub fn init(export_folder: &PathBuf) -> Result<()> { } } + +pub fn export_registered(list: &Vec) -> Result<()> { + + let templates_nota = util::envs::magic_folder(); + let mut templates_nota = PathBuf::from(templates_nota); + templates_nota.push("templates"); + templates_nota.push("nota"); + templates_nota.set_extension("html"); + + + let export_folder = util::envs::export_folder(); + let mut data = BTreeMap::new(); + + let mut handlebars = Handlebars::new(); + handlebars.register_template_file("entry", templates_nota).expect("damn"); + + for item in list { + let item_path = item.file_path.clone(); + let mut original_file = File::open(&item_path)?; + let metadata = original_file.metadata()?; + let mut out_file = PathBuf::from(&export_folder); + + let name = item_path + .file_name().unwrap() + .to_str().unwrap(); + + out_file.push(name); + out_file.set_extension("html"); + + debug!("export file: {:?} to {:?}", &item.file_path, &out_file); + + let a = parser::parse_to_html(item_path)?; + + data.insert("body".to_string(), a); + + let dt = Utc.timestamp( metadata.modified()?.duration_since(SystemTime::UNIX_EPOCH)?.as_secs().try_into().unwrap(), 0 ); + + data.insert("lastmodified".to_string(),dt.to_rfc2822() ); + + let mut output_file = File::create(out_file).unwrap(); + + output_file.write_all(handlebars.render("entry", &data).unwrap().as_bytes()).expect("TODO remove expects"); + } + + Ok(()) +} + pub fn export(file_path: Option) -> Result<()> { + let templates_nota = util::envs::magic_folder(); + let mut templates_nota = PathBuf::from(templates_nota); + templates_nota.push("templates"); + templates_nota.push("nota"); + templates_nota.set_extension("html"); + + let mut handlebars = Handlebars::new(); - handlebars.register_template_string("entry", templates::entry)?; + handlebars.register_template_file("entry", templates_nota).expect("damn"); handlebars.register_template_string("index", templates::index)?; match file_path { diff --git a/src/exporter/templates.rs b/src/exporter/templates.rs index 18dc180..b70bdc5 100644 --- a/src/exporter/templates.rs +++ b/src/exporter/templates.rs @@ -9,9 +9,15 @@ pub const entry : &str = -
- -
+
+
+

Title title

+

Last Modified: akljdlakjdlakjd

+
+

Last Modified: akljdlakjdlakjd

+
+
+ {{{body}}}
⬅️ Back to index diff --git a/src/lib.rs b/src/lib.rs index 49a07fb..ac3f2f2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -207,8 +207,10 @@ pub fn command_list() { pub fn command_export(input: Option, outfolder: PathBuf) { debug!("Export command input {:?} outfolder {:?}", input, outfolder); + let index = index::list::load().expect("TODO remove expect"); + exporter::exporter::init(&outfolder); - exporter::exporter::export(input); + exporter::exporter::export_registered(&index); } pub fn command_agenda() {