5 Commits

Author SHA1 Message Date
c59283b3fc 🦫 2024-01-06 20:17:04 +00:00
662dd48e9c update screenshot 2024-01-02 20:00:43 +00:00
309f201de6 fix readme showing in listings 2024-01-02 19:38:25 +00:00
e0277641a2 fix plaintext files not showing properly 2024-01-02 19:32:00 +00:00
b00973d18d add old name to readme 2024-01-02 18:38:35 +00:00
3 changed files with 13 additions and 8 deletions

View File

@@ -142,6 +142,9 @@ class FileMap:
if '.git' in path.parts:
continue
if 'readme.md' == path.name:
continue
if path.is_dir():
entry = self._get_directory_properties(
path, include_index_entries=False)
@@ -198,6 +201,7 @@ class FileMap:
r['raw'] = self.output_dir.joinpath(
input_filepath.relative_to(self.input_dir))
r['web'] = webpath(r['html'])
r['web_raw'] = webpath(r['raw'])
return r
@@ -288,7 +292,11 @@ def render_plaintext_file(input_filepath):
raw_content = input_filepath.read_text()
properties = FILEMAP.get(input_filepath)
html = JINJA_TEMPLATE_TEXTARTICLE.render(license=LICENSE, **properties)
html = JINJA_TEMPLATE_TEXTARTICLE.render(
license=LICENSE,
**properties,
raw_link=properties['dst_path']['web_raw'],
raw_content=raw_content)
properties['dst_path']['raw'].write_text(raw_content)
properties['dst_path']['html'].write_text(html)
@@ -487,9 +495,6 @@ def main(args):
# render each file
for file in files:
# don't render readme.md as index as it is used for directory
if file == "readme.md":
continue
render_file(root.joinpath(file))
process_home_index(args)

View File

@@ -1,11 +1,11 @@
# gronk
# :beaver: gronk
View your notes as a static html site. Browse a live sample of it [here](https://notes.alv.cx).
Formerly notes2web.
View your notes as a static HTML site. Powers [notes.alv.cx](https://notes.alv.cx).
![](./screenshot.png)
Tested with [pandoc v2.19.2](https://github.com/jgm/pandoc/releases/tag/2.19.2).
## Why?

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 KiB

After

Width:  |  Height:  |  Size: 172 KiB