Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
0f64ca5849
|
|||
8bd9173847
|
|||
dc4560c232
|
|||
da0d9db113
|
|||
98a6649a39
|
|||
0ae70aa2b3
|
|||
a91f5dcdfc
|
|||
df8febd3cf
|
|||
32a32b873e
|
|||
82e5c3e254
|
|||
c8e8ecd76c
|
|||
45e9e9a95e
|
|||
48268770b7
|
|||
79f5acd020
|
|||
a10bca718b
|
|||
18ea2a3b04
|
|||
8cc14c8a3e
|
|||
a17b475a4b
|
|||
03fff83930
|
|||
2a35e967f0
|
|||
8ba82c2911
|
|||
b050b36747
|
|||
8e09404520
|
|||
1c4dad1b2e
|
|||
9ccf00e78a
|
|||
59eccec7c4
|
|||
adc2a36fc2
|
|||
3368bdb999
|
|||
8f5d1a1a3b
|
|||
b6e69f5596
|
|||
bbb49d7a34
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
env
|
||||
n
|
||||
web
|
||||
__pycache__
|
||||
|
7
Makefile
7
Makefile
@@ -1,13 +1,16 @@
|
||||
install:
|
||||
cp notes2web.py n2w_add_uuid.py /usr/local/bin
|
||||
pip3 install -r requirements.txt
|
||||
cp n2w_add_uuid.py /usr/local/bin
|
||||
sed "s/N2W_COMMIT = \"\"/N2W_COMMIT = \"$$(git rev-parse --short HEAD)\"/" notes2web.py > /usr/local/bin/notes2web.py
|
||||
pip3 install -r requirements.txt --break-system-packages
|
||||
mkdir -p /opt/notes2web
|
||||
cp -r templates /opt/notes2web
|
||||
cp styles.css /opt/notes2web
|
||||
cp fuse.js /opt/notes2web
|
||||
cp search.js /opt/notes2web
|
||||
cp indexsearch.js /opt/notes2web
|
||||
cp toc_search.js /opt/notes2web
|
||||
cp permalink.js /opt/notes2web
|
||||
chmod +x /usr/local/bin/notes2web.py
|
||||
|
||||
uninstall:
|
||||
rm -rf /usr/local/bin/notes2web.py /usr/local/bin/n2w_add_uuid.py /opt/notes2web
|
||||
|
75
indexsearch.js
Normal file
75
indexsearch.js
Normal file
@@ -0,0 +1,75 @@
|
||||
const HEADERS = "headers"
|
||||
const PATH = "path"
|
||||
const TAGS = "tags"
|
||||
const TITLE = "title"
|
||||
|
||||
const SEARCH_TIMEOUT_MS = 100
|
||||
var SEARCH_TIMEOUT_ID = -1
|
||||
|
||||
const fuse = new Fuse(data, {
|
||||
keys: [ 'title' ],
|
||||
ignoreLocation: true,
|
||||
threshhold: 0.4,
|
||||
minMatchCharLength: 0,
|
||||
})
|
||||
|
||||
const RESULTS_MAX = 15
|
||||
|
||||
const searchBar = document.getElementById('search')
|
||||
const resultsDiv = document.getElementById('searchResults')
|
||||
|
||||
var results = []
|
||||
|
||||
function updateResultsWithTimeout() {
|
||||
console.log("clearing timeout")
|
||||
if (SEARCH_TIMEOUT_ID) SEARCH_TIMEOUT_ID = clearTimeout(SEARCH_TIMEOUT_ID)
|
||||
SEARCH_TIMEOUT_ID = setTimeout(updateResults, SEARCH_TIMEOUT_MS)
|
||||
}
|
||||
|
||||
function updateResults() {
|
||||
console.log("updating results")
|
||||
resultsDiv.innerHTML = ''
|
||||
if (searchBar.value) results = fuse.search(searchBar.value, { limit: RESULTS_MAX }).map(r => r.item)
|
||||
else results = data
|
||||
|
||||
results.forEach(r => {
|
||||
wrapper = document.createElement('li')
|
||||
wrapper.className = "article"
|
||||
|
||||
atag = document.createElement('a')
|
||||
atag.href = r.path
|
||||
|
||||
ptag = document.createElement('p')
|
||||
ptag.innerHTML = r.title + (r.isdirectory ? '/' : '')
|
||||
|
||||
atag.appendChild(ptag)
|
||||
wrapper.appendChild(atag)
|
||||
resultsDiv.appendChild(wrapper)
|
||||
})
|
||||
}
|
||||
|
||||
searchBar.addEventListener('keyup', e => {
|
||||
console.log(e)
|
||||
// if user pressed enter
|
||||
if (e.keyCode === 13) {
|
||||
if (e.shiftKey) {
|
||||
window.open(results[0].path, '_blank')
|
||||
} else {
|
||||
window.location.href = results[0].path
|
||||
}
|
||||
return
|
||||
}
|
||||
updateResultsWithTimeout()
|
||||
})
|
||||
|
||||
searchBar.addEventListener('change', updateResultsWithTimeout)
|
||||
|
||||
const searchParams = new URL(window.location.href).searchParams;
|
||||
searchBar.value = searchParams.get('q');
|
||||
updateResults();
|
||||
|
||||
console.log(results)
|
||||
|
||||
if (searchParams.has('lucky')) {
|
||||
window.location.href = results[0].path;
|
||||
}
|
76
notes2web.py
76
notes2web.py
@@ -12,6 +12,7 @@ import shutil
|
||||
import os
|
||||
import regex as re
|
||||
import json
|
||||
import yaml
|
||||
|
||||
|
||||
TEXT_ARTICLE_TEMPLATE_FOOT = None
|
||||
@@ -20,6 +21,11 @@ INDEX_TEMPLATE_FOOT = None
|
||||
INDEX_TEMPLATE_HEAD = None
|
||||
EXTRA_INDEX_CONTENT = None
|
||||
|
||||
N2W_COMMIT = ""
|
||||
|
||||
|
||||
def is_plaintext(filename):
|
||||
return re.match(r'^text/', magic.from_file(str(filename), mime=True)) is not None
|
||||
|
||||
def get_files(folder):
|
||||
markdown = []
|
||||
@@ -33,7 +39,7 @@ def get_files(folder):
|
||||
name = os.path.join(root, filename)
|
||||
if pathlib.Path(name).suffix == '.md':
|
||||
markdown.append(name)
|
||||
elif re.match(r'^text/', magic.from_file(name, mime=True)):
|
||||
elif is_plaintext(name):
|
||||
plaintext.append(name)
|
||||
other.append(name)
|
||||
else:
|
||||
@@ -41,6 +47,34 @@ def get_files(folder):
|
||||
|
||||
return markdown, plaintext, other
|
||||
|
||||
def get_inherited_tags(file, base_folder):
|
||||
tags = []
|
||||
folder = pathlib.Path(file)
|
||||
|
||||
while folder != base_folder.parent:
|
||||
print(f"get_inherited_tags {folder=}")
|
||||
folder = pathlib.Path(folder).parent
|
||||
folder_metadata = folder.joinpath('.n2w.yml')
|
||||
if not folder_metadata.exists():
|
||||
continue
|
||||
|
||||
with open(folder.joinpath('.n2w.yml')) as fp:
|
||||
folder_properties = yaml.safe_load(fp)
|
||||
|
||||
tags += folder_properties.get('itags')
|
||||
|
||||
print(f"get_inherited_tags {tags=}")
|
||||
return list(set(tags))
|
||||
|
||||
|
||||
def git_head_sha1(working_dir):
|
||||
git_response = subprocess.run(
|
||||
[ 'git', f"--git-dir={working_dir.joinpath('.git')}", 'rev-parse', '--short', 'HEAD' ],
|
||||
stdout=subprocess.PIPE
|
||||
).stdout.decode('utf-8')
|
||||
|
||||
return git_response.strip()
|
||||
|
||||
|
||||
def git_filehistory(working_dir, filename):
|
||||
print(f"{pathlib.Path(filename).relative_to(working_dir)=}")
|
||||
@@ -119,6 +153,7 @@ def get_args():
|
||||
parser.add_argument('-F', '--force', action="store_true", help="Generate new output html even if source file was modified before output html")
|
||||
parser.add_argument('--fuse', type=pathlib.Path, default=pathlib.Path('/opt/notes2web/fuse.js'))
|
||||
parser.add_argument('--searchjs', type=pathlib.Path, default=pathlib.Path('/opt/notes2web/search.js'))
|
||||
parser.add_argument('--indexsearchjs', type=pathlib.Path, default=pathlib.Path('/opt/notes2web/indexsearch.js'))
|
||||
parser.add_argument('--permalinkjs', type=pathlib.Path, default=pathlib.Path('/opt/notes2web/permalink.js'))
|
||||
parser.add_argument('--tocsearchjs', type=pathlib.Path, default=pathlib.Path('/opt/notes2web/toc_search.js'))
|
||||
parser.add_argument('--toc-depth', type=int, default=6, dest='toc_depth')
|
||||
@@ -178,7 +213,7 @@ def main(args):
|
||||
# extract tags from frontmatter, save to tag_dict
|
||||
fm = frontmatter.load(filename)
|
||||
if isinstance(fm.get('tags'), list):
|
||||
for tag in fm.get('tags'):
|
||||
for tag in list(set(fm.get('tags') + get_inherited_tags(filename, args.notes))):
|
||||
t = {
|
||||
'path': str(pathlib.Path(output_filename).relative_to(args.output_dir)),
|
||||
'title': fm.get('title') or pathlib.Path(filename).name
|
||||
@@ -199,7 +234,7 @@ def main(args):
|
||||
all_entries.append({
|
||||
'path': '/' + str(pathlib.Path(*pathlib.Path(output_filename).parts[1:])),
|
||||
'title': fm.get('title') or pathlib.Path(filename).name,
|
||||
'tags': fm.get('tags'),
|
||||
'tags': list(set(fm.get('tags'))),
|
||||
'headers': header_lines,
|
||||
'uuid': fm.get('uuid')
|
||||
})
|
||||
@@ -210,10 +245,15 @@ def main(args):
|
||||
# update file if required
|
||||
if update_required(filename, output_filename) or args.force:
|
||||
filehistory = git_filehistory(args.notes, filename)
|
||||
html = pypandoc.convert_file(filename, 'html', extra_args=[
|
||||
with open(filename) as fp:
|
||||
article = frontmatter.load(fp)
|
||||
|
||||
article['tags'] += get_inherited_tags(filename, args.notes)
|
||||
article['tags'] = sorted(list(set(article['tags'])))
|
||||
article['filehistory'] = filehistory
|
||||
article['licenseFull'] = notes_license
|
||||
html = pypandoc.convert_text(frontmatter.dumps(article), 'html', format='md', extra_args=[
|
||||
f'--template={args.template}',
|
||||
'-V', f'filehistory={filehistory}',
|
||||
'-V', f'licenseFull={notes_license}',
|
||||
'--mathjax',
|
||||
'--toc', f'--toc-depth={args.toc_depth}'
|
||||
])
|
||||
@@ -248,7 +288,7 @@ def main(args):
|
||||
all_entries.append({
|
||||
'path': str(pathlib.Path(*pathlib.Path(output_filename).parts[1:])),
|
||||
'title': title,
|
||||
'tags': [],
|
||||
'tags': [get_inherited_tags(filename, args.notes)],
|
||||
'headers': []
|
||||
})
|
||||
|
||||
@@ -259,11 +299,12 @@ def main(args):
|
||||
pathlib.Path(filename).relative_to(args.notes)
|
||||
)
|
||||
)
|
||||
title = os.path.basename(filename)
|
||||
pathlib.Path(output_filename).parent.mkdir(parents=True, exist_ok=True)
|
||||
all_entries.append({
|
||||
'path': str(pathlib.Path(*pathlib.Path(output_filename).parts[1:])),
|
||||
'title': str(pathlib.Path(*pathlib.Path(output_filename).parts[1:])),
|
||||
'tags': [],
|
||||
'title': title,
|
||||
'tags': [get_inherited_tags(filename, args.notes)],
|
||||
'headers': []
|
||||
})
|
||||
shutil.copyfile(filename, output_filename)
|
||||
@@ -277,14 +318,13 @@ def main(args):
|
||||
html = re.sub(r'\$extra_content\$', '', html)
|
||||
|
||||
for entry in tag_dict[tag]:
|
||||
html += f"<div class=\"article\"><a href=\"/{entry['path']}\">{entry['title']}</a></div>"
|
||||
html += INDEX_TEMPLATE_FOOT
|
||||
entry['path'] = '/' + entry['path']
|
||||
html += f"<div class=\"article\"><a href=\"{entry['path']}\">{entry['title']}</a></div>"
|
||||
html += re.sub('\$data\$', json.dumps(tag_dict[tag]), INDEX_TEMPLATE_FOOT)
|
||||
|
||||
with open(tagdir.joinpath(f'{tag}.html'), 'w+') as fp:
|
||||
fp.write(html)
|
||||
|
||||
|
||||
|
||||
dirs_to_index = [args.output_dir.name] + get_dirs_to_index(args.output_dir)
|
||||
print(f"{dirs_to_index=}")
|
||||
print(f"{dirs_with_index_article=}")
|
||||
@@ -307,6 +347,7 @@ def main(args):
|
||||
continue
|
||||
|
||||
fullpath = directory.joinpath(path)
|
||||
title = path.name
|
||||
if path.suffix == '.html':
|
||||
with open(fullpath) as fp:
|
||||
soup = bs(fp.read(), 'html.parser')
|
||||
@@ -317,7 +358,7 @@ def main(args):
|
||||
title = pathlib.Path(path).stem
|
||||
elif fullpath.is_dir():
|
||||
title = path
|
||||
else:
|
||||
elif is_plaintext(fullpath):
|
||||
# don't add plaintext files to index, since they have a html wrapper
|
||||
continue
|
||||
|
||||
@@ -326,7 +367,7 @@ def main(args):
|
||||
|
||||
indexentries.append({
|
||||
'title': str(title),
|
||||
'path': str(path),
|
||||
'path': './' + str(path),
|
||||
'isdirectory': fullpath.is_dir()
|
||||
})
|
||||
|
||||
@@ -348,7 +389,7 @@ def main(args):
|
||||
'</p></a>'
|
||||
'</li>'
|
||||
)
|
||||
html += INDEX_TEMPLATE_FOOT
|
||||
html += re.sub(r'\$data\$', json.dumps(indexentries), INDEX_TEMPLATE_FOOT)
|
||||
|
||||
with open(directory.joinpath('index.html'), 'w+') as fp:
|
||||
fp.write(html)
|
||||
@@ -356,12 +397,15 @@ def main(args):
|
||||
shutil.copyfile(args.stylesheet, args.output_dir.joinpath('styles.css'))
|
||||
shutil.copyfile(args.fuse, args.output_dir.joinpath('fuse.js'))
|
||||
shutil.copyfile(args.searchjs, args.output_dir.joinpath('search.js'))
|
||||
shutil.copyfile(args.indexsearchjs, args.output_dir.joinpath('indexsearch.js'))
|
||||
shutil.copyfile(args.tocsearchjs, args.output_dir.joinpath('toc_search.js'))
|
||||
shutil.copyfile(args.permalinkjs, args.output_dir.joinpath('permalink.js'))
|
||||
with open(args.output_dir.joinpath('index.html'), 'w+') as fp:
|
||||
with open(args.home_index) as fp2:
|
||||
html = re.sub(r'\$title\$', args.output_dir.parts[0], fp2.read())
|
||||
html = re.sub(r'\$h1title\$', args.output_dir.parts[0], html)
|
||||
html = re.sub(r'\$n2w_commit\$', N2W_COMMIT, html)
|
||||
html = re.sub(r'\$notes_git_head_sha1\$', git_head_sha1(args.notes), html)
|
||||
|
||||
html = re.sub(r'\$data\$', json.dumps(all_entries), html)
|
||||
|
||||
|
30
readme.md
30
readme.md
@@ -1,9 +1,13 @@
|
||||
> notes2web is now called [gronk](https://github.com/alvierahman90/gronk) and development has moved
|
||||
|
||||
# notes2web
|
||||
|
||||
View your notes as a static html site. Browse a live sample of it [here](https://notes.alv.cx).
|
||||
|
||||

|
||||
|
||||
Tested with [pandoc v2.19.2](https://github.com/jgm/pandoc/releases/tag/2.19.2).
|
||||
|
||||
|
||||
## Why?
|
||||
|
||||
@@ -20,13 +24,7 @@ doing it for me:
|
||||
|
||||
## Install
|
||||
|
||||
0. Install [Pandoc](https://pandoc.org/index.html) and [Pip](https://github.com/pypa/pip)
|
||||
|
||||
On arch:
|
||||
```
|
||||
# pacman -S pandoc python-pip
|
||||
```
|
||||
|
||||
0. Install [Pandoc](https://pandoc.org/index.html) and [Pip](https://github.com/pypa/pip), python3-dev, and a C compiler
|
||||
1. Run `make install` as root
|
||||
|
||||
## Things to Remember Whilst Writing Notes
|
||||
@@ -38,6 +36,8 @@ doing it for me:
|
||||
searching
|
||||
- `title` --- The title of the article
|
||||
- `uuid` --- A unique identifier used for permalinks. More below.
|
||||
- `lecture_slides` --- a list of paths pointing to lecture slides used while taking notes
|
||||
- `lecture_notes` --- a list of paths pointing to other notes used while taking notes
|
||||
|
||||
- notes2web indexes [ATX-style headings](https://pandoc.org/MANUAL.html#atx-style-headings) for
|
||||
searching
|
||||
@@ -59,6 +59,22 @@ The included `n2w_add_uuid.py` will add a UUID to a markdown file which does not
|
||||
already.
|
||||
Combine it with `find` to UUIDify all your markdown files (but make a backup first).
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
Notes can inherit a some properties from their parent folder(s) by creating a `.n2w.yml` file in a
|
||||
folder.
|
||||
|
||||
#### Tags
|
||||
|
||||
If you have a folder `uni` with all you university notes, you might want all the files in there to
|
||||
be tagged `uni`:
|
||||
|
||||
`NOTES_PATH/uni/.n2w.yaml`:
|
||||
|
||||
```yaml
|
||||
itags: [ university ]
|
||||
```
|
||||
|
||||
## CLI Usage
|
||||
|
||||
```
|
||||
|
@@ -6,6 +6,6 @@ oyaml==1.0
|
||||
pypandoc==1.5
|
||||
python-frontmatter==1.0.0
|
||||
python-magic==0.4.24
|
||||
PyYAML==5.4.1
|
||||
PyYAML==5.3.1
|
||||
regex==2021.11.10
|
||||
soupsieve==2.2.1
|
||||
|
34
search.js
34
search.js
@@ -3,37 +3,51 @@ const PATH = "path"
|
||||
const TAGS = "tags"
|
||||
const TITLE = "title"
|
||||
|
||||
const SEARCH_TIMEOUT_MS = 100
|
||||
var SEARCH_TIMEOUT_ID = -1
|
||||
|
||||
const fuse = new Fuse(data, {
|
||||
keys: [
|
||||
{
|
||||
name: HEADERS,
|
||||
weight: 2
|
||||
weight: 0.2
|
||||
},
|
||||
{
|
||||
name: PATH,
|
||||
weight: 0.5
|
||||
weight: 0.1
|
||||
},
|
||||
{
|
||||
name: TAGS,
|
||||
weight: 1.5
|
||||
weight: 0.1
|
||||
},
|
||||
{
|
||||
name: TITLE,
|
||||
weight: 1.5
|
||||
weight: 4
|
||||
}
|
||||
],
|
||||
includeMatches: true
|
||||
includeMatches: true,
|
||||
useExtendedSearch: true,
|
||||
ignoreLocation: true,
|
||||
threshhold: 0.4,
|
||||
})
|
||||
|
||||
const RESULTS_MAX = 5
|
||||
|
||||
const searchBar = document.getElementById('search')
|
||||
const resultsMax = document.getElementById('resultsMax')
|
||||
const resultsDiv = document.getElementById('results')
|
||||
|
||||
var results = []
|
||||
|
||||
function updateResultsWithTimeout() {
|
||||
console.log("clearing timeout")
|
||||
if (SEARCH_TIMEOUT_ID) SEARCH_TIMEOUT_ID = clearTimeout(SEARCH_TIMEOUT_ID)
|
||||
SEARCH_TIMEOUT_ID = setTimeout(updateResults, SEARCH_TIMEOUT_MS)
|
||||
}
|
||||
|
||||
function updateResults() {
|
||||
console.log("updating results")
|
||||
resultsDiv.innerHTML = ''
|
||||
results = fuse.search(searchBar.value).slice(0, parseInt(resultsMax.value))
|
||||
results = fuse.search(searchBar.value, { limit: RESULTS_MAX })
|
||||
results.forEach(r => {
|
||||
wrapper = document.createElement('div')
|
||||
wrapper.className = "article"
|
||||
@@ -95,12 +109,10 @@ searchBar.addEventListener('keyup', e => {
|
||||
}
|
||||
return
|
||||
}
|
||||
updateResults()
|
||||
updateResultsWithTimeout()
|
||||
})
|
||||
|
||||
searchBar.addEventListener('change', updateResults)
|
||||
resultsMax.addEventListener('keyup', updateResults)
|
||||
resultsMax.addEventListener('change', updateResults)
|
||||
searchBar.addEventListener('change', updateResultsWithTimeout)
|
||||
|
||||
const searchParams = new URL(window.location.href).searchParams;
|
||||
searchBar.value = searchParams.get('q');
|
||||
|
21
styles.css
21
styles.css
@@ -1,6 +1,8 @@
|
||||
@import url("https://styles.alv.cx/colors/gruvbox.css");
|
||||
@import url("https://styles.alv.cx/base.css");
|
||||
@import url("https://styles.alv.cx/modules/search.css");
|
||||
@import url("https://styles.alv.cx/modules/buttonlist.css");
|
||||
@import url("https://styles.alv.cx/modules/darkmode.css");
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
@@ -29,10 +31,10 @@ body {
|
||||
}
|
||||
|
||||
.matchHighlight {
|
||||
background-color: #86c1b9;
|
||||
background-color: var(--blue);
|
||||
}
|
||||
|
||||
#sidebar > #header { padding-bottom: 1em; color: #656565;}
|
||||
#sidebar > #header { padding-bottom: 1em; color: var(--fg-lc);}
|
||||
|
||||
#header > * {
|
||||
margin: 0;
|
||||
@@ -71,12 +73,12 @@ body {
|
||||
|
||||
#sidebar,
|
||||
#toc li > a {
|
||||
color: #656565;
|
||||
color: var(--fg-lc);
|
||||
}
|
||||
|
||||
#toc li, ul#articlelist { list-style: none; }
|
||||
#toc ul, ul#articlelist { margin-left: 0.75em ; padding-left: 0.75em; }
|
||||
#toc ul, ul#articlelist { border-left: 1px solid #b3b3b3;}
|
||||
#toc ul, ul#articlelist { border-left: 1px solid var(--fg-lc);}
|
||||
#toc > ul { padding; none; padding: 0; margin: 0; border: none;max-width: 100%;}
|
||||
li { padding: 0 !important; }
|
||||
|
||||
@@ -91,18 +93,21 @@ ul#articlelist > a{
|
||||
}
|
||||
#toc li > a:hover,
|
||||
ul#articlelist li a:hover {
|
||||
background: #d9d9d9;
|
||||
background: var(--bg-lc);
|
||||
color: black;
|
||||
}
|
||||
|
||||
mjx-container {
|
||||
overflow-x: scroll;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 60em) {
|
||||
p.metadata { margin: 0 }
|
||||
|
||||
@media (max-width: 80em) {
|
||||
/* CSS that should be displayed if width is equal to or less than 60em goes here */
|
||||
#contentWrapper { flex-direction: column }
|
||||
#sidebar { position: static; width: 100%; max-width: none; }
|
||||
#sidebar { position: static; width: 100%; max-width: none; height: auto; }
|
||||
#tocWrapper { display: none }
|
||||
}
|
||||
|
||||
|
||||
|
@@ -4,38 +4,56 @@
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" />
|
||||
<link rel="stylesheet" type="text/css" href="/styles.css" />
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
tags: 'ams'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
<title>$title$</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="contentWrapper">
|
||||
<div id="sidebar">
|
||||
<div id="header">
|
||||
<p class="smallText">
|
||||
<a href="/permalink?uuid=$uuid$">permalink</a>
|
||||
<div id="content">
|
||||
<p class="smallText metadata">
|
||||
title: $title$
|
||||
</p>
|
||||
<p class="smallText"> tags: [
|
||||
$if(lecture_slides)$
|
||||
<p class="smallText metadata"> lecture_slides: [
|
||||
$for(lecture_slides)$
|
||||
<a href="$lecture_slides$">$lecture_slides$</a>$sep$,
|
||||
$endfor$
|
||||
]</p>
|
||||
$endif$
|
||||
$if(lecture_notes)$
|
||||
<p class="smallText metadata"> lecture_notes: [
|
||||
$for(lecture_notes)$
|
||||
<a href="$lecture_notes$">$lecture_notes$</a>$sep$,
|
||||
$endfor$
|
||||
]</p>
|
||||
$endif$
|
||||
|
||||
<p class="smallText metadata">
|
||||
uuid: $uuid$ (<a href="/permalink?uuid=$uuid$">permalink</a>)
|
||||
</p>
|
||||
<p class="smallText metadata"> tags: [
|
||||
$for(tags)$
|
||||
<a href="/.tags/$tags$.html">$tags$</a>$sep$,
|
||||
$endfor$
|
||||
]</p>
|
||||
<p class="smallText">
|
||||
<p class="smallText metadata">
|
||||
written by $for(author)$$author$$sep$, $endfor$
|
||||
</p>
|
||||
<p class="smallText">
|
||||
<p class="smallText metadata">
|
||||
syntax highlighting based on <a href="https://pygments.org/">Pygments'</a> default
|
||||
colors
|
||||
</p>
|
||||
<p class="smallText">
|
||||
<p class="smallText metadata">
|
||||
page generated by <a href="https://git.alv.cx/alvierahman90/notes2web">notes2web</a>
|
||||
</p>
|
||||
</div>
|
||||
<h3>Table of Contents</h3>
|
||||
<input id="search" placeholder="Search table of contents" />
|
||||
<div id="toc">$toc$</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<details id="commitLog">
|
||||
<summary class="smallText">
|
||||
Commit log (file history)
|
||||
|
@@ -14,14 +14,13 @@ Browse <a href="/notes">here</a> or by tag <a href="/.tags">here</a>.
|
||||
</p>
|
||||
|
||||
<div id="searchWrapper">
|
||||
<input placeholder="Search" id="search" autofocus>
|
||||
<input type="number" id="resultsMax" min="0" value="5">
|
||||
<input autocomplete="off" placeholder="search" id="search" autofocus>
|
||||
</div>
|
||||
<p class="smallText" style="margin-top: 0; text-align: center;"> Press <kbd>Enter</kbd> to open first result or <kbd>Shift</kbd>+<kbd>Enter</kbd> to open in new tab</p>
|
||||
<div id="results">
|
||||
</div>
|
||||
|
||||
<p class="smallText"> page generated by <a href="https://github.com/alvierahman90/notes2web">notes2web</a></p>
|
||||
<p class="smallText"> page generated by <a href="https://github.com/alvierahman90/notes2web">notes2web</a> (commit $n2w_commit$) notes commit $notes_git_head_sha1$</p>
|
||||
</div>
|
||||
<script src="/fuse.js"> </script>
|
||||
<script> const data = $data$ </script>
|
||||
|
@@ -1,4 +1,7 @@
|
||||
</ul>
|
||||
<p style="font-size: 0.7em;"> page generated by <a href="https://github.com/alvierahman90/notes2web">notes2web</a></p>
|
||||
</div>
|
||||
<script src="/fuse.js"> </script>
|
||||
<script> const data = $data$ </script>
|
||||
<script src="/indexsearch.js"> </script>
|
||||
</body>
|
||||
|
@@ -10,5 +10,12 @@
|
||||
<div id="content">
|
||||
<h1>$title$</h1>
|
||||
$extra_content$
|
||||
<ul class="buttonlist">
|
||||
<div id="searchWrapper">
|
||||
<input id="search" placeholder="search" autocomplete="off" autofocus>
|
||||
</div>
|
||||
<p class="searchSmallText" style="margin-top: 0; text-align: center">
|
||||
Press (<kbd>Shift</kbd>+)<kbd>Enter</kbd> to open first result (in new tab)
|
||||
</p>
|
||||
|
||||
<ul id="searchResults" class="buttonlist">
|
||||
<li class="article"><a href=".."><p>../</p></a></li>
|
||||
|
Reference in New Issue
Block a user