From 33b4c572369a55f546af2b55735613dfb8dca915 Mon Sep 17 00:00:00 2001 From: ntno Date: Wed, 18 Jan 2023 16:14:40 -0500 Subject: [PATCH 1/9] initial markdown to html plugin based on byrnereese/mkdocs-markdown-filter --- NOTES.md | 4 ++ package.json | 2 +- pyproject.toml | 3 ++ terminal/legal/legal.md | 23 +++++++++++- terminal/plugins/md_to_html/__init__.py | 0 terminal/plugins/md_to_html/plugin.py | 50 +++++++++++++++++++++++++ terminal/theme_version.html | 2 +- 7 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 terminal/plugins/md_to_html/__init__.py create mode 100644 terminal/plugins/md_to_html/plugin.py diff --git a/NOTES.md b/NOTES.md index 2e81d299..72ffd7be 100644 --- a/NOTES.md +++ b/NOTES.md @@ -50,3 +50,7 @@ Terminal for MkDocs' Tile Grid relies on the *meta*[^mkdocs-page-meta] attribute ### img tile `
]*? \ No newline at end of file + \ No newline at end of file From 71b9c0d52d738b1f80eb0d8f994277aa635d5245 Mon Sep 17 00:00:00 2001 From: ntno Date: Wed, 18 Jan 2023 16:31:48 -0500 Subject: [PATCH 2/9] worksgit add .git add . --- Makefile | 4 ++++ documentation/docs/about/debug.md | 20 ++++++++++++++++++++ documentation/local.yml | 5 +++++ documentation/mkdocs.yml | 2 ++ terminal/macros/tile-grid/tile.j2 | 2 +- 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 documentation/docs/about/debug.md diff --git a/Makefile b/Makefile index 6f49fa38..315c6f50 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,10 @@ tox: install-tox install-test-prereqs check-version-match: cat terminal/theme_version.html | grep -s --silent $(version)\"\>\$$ -o +install-from-dist: build-theme + pip uninstall mkdocs-terminal + pip install dist/*.tar.gz + #for developer use, assumes you have already installed prereqs quick-tests: flake8 --ignore E501 && \ diff --git a/documentation/docs/about/debug.md b/documentation/docs/about/debug.md new file mode 100644 index 00000000..e51833e6 --- /dev/null +++ b/documentation/docs/about/debug.md @@ -0,0 +1,20 @@ +--- +tiles: + - caption: '*@petradr*' + img_src: ../../../img/picsum/167_200x200.jpeg + img_title: 'to Picsum homepage' + img_alt: 'close up image of fallen leaves' + link_href: https://picsum.photos/ + - caption: 'Marcin **C**zerwinski' + img_src: ../../../img/picsum/127_200x200.jpeg + img_title: 'to Picsum homepage' + img_alt: 'close up image of green moss on a log' + link_href: https://picsum.photos/ + - caption: 'Steve Richey' + img_src: ../../../img/picsum/143_200x200.jpeg + img_title: 'to Picsum homepage' + img_alt: 'overhead image of fallen leaves' + link_href: https://picsum.photos/ +--- + +# Debug Markdown Experiments \ No newline at end of file diff --git a/documentation/local.yml b/documentation/local.yml index 3480c51b..069737be 100644 --- a/documentation/local.yml +++ b/documentation/local.yml @@ -15,6 +15,11 @@ theme: static_templates: - 404.html +plugins: + - git-revision-date + - search + - md-to-html + watch: - '../terminal' - './mkdocs.yml' \ No newline at end of file diff --git a/documentation/mkdocs.yml b/documentation/mkdocs.yml index cc1ea622..3fd29394 100644 --- a/documentation/mkdocs.yml +++ b/documentation/mkdocs.yml @@ -49,6 +49,8 @@ nav: - Typography: 'elements/typography.md' - Install: 'install.md' - Releases: 'releases.md' + - About: + - Debug: 'about/debug.md' markdown_extensions: # Python Markdown diff --git a/terminal/macros/tile-grid/tile.j2 b/terminal/macros/tile-grid/tile.j2 index c5a49ae1..b44dc158 100644 --- a/terminal/macros/tile-grid/tile.j2 +++ b/terminal/macros/tile-grid/tile.j2 @@ -27,7 +27,7 @@ {% else %}{{ tile.link_text|default(tile.link_href, true) }}{%- endif -%} {%- endif -%} {%- if ns.has_caption %} -
{{ tile.caption|string|trim }}
+
{{ tile.caption|string|trim|markdown }}
{%- endif %}
From f673a3f6df30220c6e74f2fa0d199fa81cf5b4e0 Mon Sep 17 00:00:00 2001 From: ntno Date: Wed, 18 Jan 2023 16:38:31 -0500 Subject: [PATCH 3/9] try auto install from terminal namespace --- documentation/local.yml | 1 - pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/documentation/local.yml b/documentation/local.yml index 069737be..b853617c 100644 --- a/documentation/local.yml +++ b/documentation/local.yml @@ -18,7 +18,6 @@ theme: plugins: - git-revision-date - search - - md-to-html watch: - '../terminal' diff --git a/pyproject.toml b/pyproject.toml index 7a20b8cc..bdf2688a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ Issues = "https://github.com/ntno/mkdocs-terminal/issues" terminal = "terminal" [project.entry-points."mkdocs.plugins"] -md-to-html = "terminal.plugins.md_to_html.plugin:MarkdownToHtmlFilterPlugin" +"terminal/md-to-html" = "terminal.plugins.md_to_html.plugin:MarkdownToHtmlFilterPlugin" [build-system] requires = [ From c71f99d9ceaa8c3373211678951c3b953d6a1ab4 Mon Sep 17 00:00:00 2001 From: ntno Date: Wed, 18 Jan 2023 16:41:53 -0500 Subject: [PATCH 4/9] bump --- Makefile | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 315c6f50..567b7d96 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ check-version-match: cat terminal/theme_version.html | grep -s --silent $(version)\"\>\$$ -o install-from-dist: build-theme - pip uninstall mkdocs-terminal + pip uninstall -Y mkdocs-terminal pip install dist/*.tar.gz #for developer use, assumes you have already installed prereqs diff --git a/package-lock.json b/package-lock.json index e9a770fb..b0dbd43d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mkdocs-terminal", - "version": "3.1.2", + "version": "3.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -68,4 +68,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 0b0b3f07..41699074 100644 --- a/package.json +++ b/package.json @@ -25,4 +25,4 @@ "engines": { "node": ">= 16" } -} \ No newline at end of file +} From 16c73a7c7f92517f62162781e4c0374d8c302b55 Mon Sep 17 00:00:00 2001 From: ntno Date: Wed, 18 Jan 2023 16:44:19 -0500 Subject: [PATCH 5/9] version update, removed invalid flag --- Makefile | 2 +- package-lock.json | 4 ++-- package.json | 4 ++-- terminal/theme_version.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 567b7d96..315c6f50 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ check-version-match: cat terminal/theme_version.html | grep -s --silent $(version)\"\>\$$ -o install-from-dist: build-theme - pip uninstall -Y mkdocs-terminal + pip uninstall mkdocs-terminal pip install dist/*.tar.gz #for developer use, assumes you have already installed prereqs diff --git a/package-lock.json b/package-lock.json index b0dbd43d..a11f8dc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mkdocs-terminal", - "version": "3.3.0", + "version": "3.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -68,4 +68,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 41699074..9044ecc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mkdocs-terminal", - "version": "3.3.0", + "version": "3.2.0", "description": "Terminal.css theme for MkDocs", "keywords": [ "mkdocs", @@ -25,4 +25,4 @@ "engines": { "node": ">= 16" } -} +} \ No newline at end of file diff --git a/terminal/theme_version.html b/terminal/theme_version.html index 5ad627b9..dfa7cd42 100644 --- a/terminal/theme_version.html +++ b/terminal/theme_version.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 0d1a11dba10d06c001a8f6993b1424dee0cf7c43 Mon Sep 17 00:00:00 2001 From: ntno Date: Wed, 18 Jan 2023 16:49:09 -0500 Subject: [PATCH 6/9] remove filter for now --- terminal/macros/tile-grid/tile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal/macros/tile-grid/tile.j2 b/terminal/macros/tile-grid/tile.j2 index b44dc158..c5a49ae1 100644 --- a/terminal/macros/tile-grid/tile.j2 +++ b/terminal/macros/tile-grid/tile.j2 @@ -27,7 +27,7 @@ {% else %}{{ tile.link_text|default(tile.link_href, true) }}{%- endif -%} {%- endif -%} {%- if ns.has_caption %} -
{{ tile.caption|string|trim|markdown }}
+
{{ tile.caption|string|trim }}
{%- endif %} From 29ff2798fc16f7286774a458ef200ba962662445 Mon Sep 17 00:00:00 2001 From: ntno Date: Wed, 18 Jan 2023 16:49:19 -0500 Subject: [PATCH 7/9] formatting --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bdf2688a..589e8d9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ Source = "https://github.com/ntno/mkdocs-terminal" Issues = "https://github.com/ntno/mkdocs-terminal/issues" [project.entry-points."mkdocs.themes"] -terminal = "terminal" +"terminal" = "terminal" [project.entry-points."mkdocs.plugins"] "terminal/md-to-html" = "terminal.plugins.md_to_html.plugin:MarkdownToHtmlFilterPlugin" From 26ce789d5e4b0823f18f5932b7ebcf4fb4b6297d Mon Sep 17 00:00:00 2001 From: ntno Date: Wed, 18 Jan 2023 16:50:22 -0500 Subject: [PATCH 8/9] reorder to match squidfunk/mkdocs-material plugin setup --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 589e8d9b..3bd1085d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,12 +28,12 @@ classifiers = [ Source = "https://github.com/ntno/mkdocs-terminal" Issues = "https://github.com/ntno/mkdocs-terminal/issues" -[project.entry-points."mkdocs.themes"] -"terminal" = "terminal" - [project.entry-points."mkdocs.plugins"] "terminal/md-to-html" = "terminal.plugins.md_to_html.plugin:MarkdownToHtmlFilterPlugin" +[project.entry-points."mkdocs.themes"] +terminal = "terminal" + [build-system] requires = [ "hatchling", From 1078720aa66400fc7b83dc18ced0bce0a09e3f81 Mon Sep 17 00:00:00 2001 From: ntno Date: Wed, 18 Jan 2023 16:54:30 -0500 Subject: [PATCH 9/9] dont include debug doc --- documentation/mkdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/mkdocs.yml b/documentation/mkdocs.yml index 3fd29394..397f4e56 100644 --- a/documentation/mkdocs.yml +++ b/documentation/mkdocs.yml @@ -49,8 +49,8 @@ nav: - Typography: 'elements/typography.md' - Install: 'install.md' - Releases: 'releases.md' - - About: - - Debug: 'about/debug.md' + # - About: + # - Debug: 'about/debug.md' markdown_extensions: # Python Markdown