mirror of
https://github.com/alvierahman90/gronk.git
synced 2025-10-13 16:04:29 +00:00
Compare commits
5 Commits
v2
...
c59283b3fc
Author | SHA1 | Date | |
---|---|---|---|
c59283b3fc
|
|||
662dd48e9c
|
|||
309f201de6
|
|||
e0277641a2
|
|||
b00973d18d
|
13
gronk.py
13
gronk.py
@@ -142,6 +142,9 @@ class FileMap:
|
|||||||
if '.git' in path.parts:
|
if '.git' in path.parts:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if 'readme.md' == path.name:
|
||||||
|
continue
|
||||||
|
|
||||||
if path.is_dir():
|
if path.is_dir():
|
||||||
entry = self._get_directory_properties(
|
entry = self._get_directory_properties(
|
||||||
path, include_index_entries=False)
|
path, include_index_entries=False)
|
||||||
@@ -198,6 +201,7 @@ class FileMap:
|
|||||||
r['raw'] = self.output_dir.joinpath(
|
r['raw'] = self.output_dir.joinpath(
|
||||||
input_filepath.relative_to(self.input_dir))
|
input_filepath.relative_to(self.input_dir))
|
||||||
r['web'] = webpath(r['html'])
|
r['web'] = webpath(r['html'])
|
||||||
|
r['web_raw'] = webpath(r['raw'])
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
|
||||||
@@ -288,7 +292,11 @@ def render_plaintext_file(input_filepath):
|
|||||||
|
|
||||||
raw_content = input_filepath.read_text()
|
raw_content = input_filepath.read_text()
|
||||||
properties = FILEMAP.get(input_filepath)
|
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']['raw'].write_text(raw_content)
|
||||||
properties['dst_path']['html'].write_text(html)
|
properties['dst_path']['html'].write_text(html)
|
||||||
|
|
||||||
@@ -487,9 +495,6 @@ def main(args):
|
|||||||
|
|
||||||
# render each file
|
# render each file
|
||||||
for file in files:
|
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))
|
render_file(root.joinpath(file))
|
||||||
|
|
||||||
process_home_index(args)
|
process_home_index(args)
|
||||||
|
@@ -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).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Tested with [pandoc v2.19.2](https://github.com/jgm/pandoc/releases/tag/2.19.2).
|
|
||||||
|
|
||||||
|
|
||||||
## Why?
|
## Why?
|
||||||
|
|
||||||
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 340 KiB After Width: | Height: | Size: 172 KiB |
Reference in New Issue
Block a user