Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
4 changes: 4 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ Terminal for MkDocs' Tile Grid relies on the *meta*[^mkdocs-page-meta] attribute
### img tile
`<div .*? <figure(.)[^>]*? <img(.)*`



[project.entry-points."mkdocs.plugins"]
# markdown-filter = "mkdocs_markdown_filter.plugin:MarkdownFilterPlugin"
20 changes: 20 additions & 0 deletions documentation/docs/about/debug.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions documentation/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ theme:
static_templates:
- 404.html

plugins:
- git-revision-date
- search

watch:
- '../terminal'
- './mkdocs.yml'
2 changes: 2 additions & 0 deletions documentation/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ nav:
- Typography: 'elements/typography.md'
- Install: 'install.md'
- Releases: 'releases.md'
# - About:
# - Debug: 'about/debug.md'

markdown_extensions:
# Python Markdown
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mkdocs-terminal",
"version": "3.1.2",
"version": "3.2.0",
"description": "Terminal.css theme for MkDocs",
"keywords": [
"mkdocs",
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ classifiers = [
Source = "https://github.com/ntno/mkdocs-terminal"
Issues = "https://github.com/ntno/mkdocs-terminal/issues"

[project.entry-points."mkdocs.plugins"]
"terminal/md-to-html" = "terminal.plugins.md_to_html.plugin:MarkdownToHtmlFilterPlugin"

[project.entry-points."mkdocs.themes"]
terminal = "terminal"

Expand Down
23 changes: 22 additions & 1 deletion terminal/legal/legal.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[open-source-template](https://github.com/auth0/open-source-template/blob/master/LICENSE) by [@auth0](https://github.com/auth0)

[mkdocs/mkdocs](https://github.com/mkdocs/mkdocs/blob/master/LICENSE)
```
```text
Copyright © 2014-present, Tom Christie. All rights reserved.

Redistribution and use in source and binary forms, with or
Expand Down Expand Up @@ -87,3 +87,24 @@ POSSIBILITY OF SUCH DAMAGE.
```text
Creative Commons ― CC BY 3.0
```

[mkdocs-markdown-filter](https://github.com/byrnereese/mkdocs-markdown-filter/blob/master/LICENSE) by [Byrne Reese](https://github.com/byrnereese)
```text
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
Empty file.
50 changes: 50 additions & 0 deletions terminal/plugins/md_to_html/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (c) 2018 Byrne Reese
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# import os
# import sys
# import re
# from timeit import default_timer as timer
# from datetime import datetime, timedelta
# from mkdocs import utils as mkdocs_utils
# from mkdocs.config import config_options, Config
from mkdocs.plugins import BasePlugin
import jinja2
# from jinja2.ext import Extension
import markdown


class MarkdownToHtmlFilterPlugin(BasePlugin):

config_scheme = (
)

def __init__(self):
self.enabled = True
self.dirs = []

def md_filter(self, text, **kwargs):
md = markdown.Markdown(
extensions=self.config['markdown_extensions'],
extension_configs=self.config['mdx_configs'] or {}
)
return jinja2.Markup(md.convert(text))

def on_env(self, env, config, files):
self.config = config
env.filters['markdown'] = self.md_filter
return env
2 changes: 1 addition & 1 deletion terminal/theme_version.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-terminal-3.1.2">
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-terminal-3.2.0">