Skip to content

Commit eff7a73

Browse files
committed
fix README.md generation
1 parent 445e075 commit eff7a73

File tree

3 files changed

+49
-42
lines changed

3 files changed

+49
-42
lines changed

README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,9 @@
1-
# mkdocs-encryptcontent-plugin
2-
3-
# Table of Contents
4-
* [Todos for 3.0.x](#Todos-for-3.0.x)
5-
* [Todos for 3.1.x](#Todos-for-3.1.x)
6-
* [Installation](#Installation)
7-
* [Usage](#Usage)
8-
* [Global password protection](#Global-password-protection)
9-
* [Password inventory](#Password-inventory)
10-
* [Secret from environment](#Secret-from-environment)
11-
* [Default vars customization](#Default-vars-customization)
12-
* [Translations](#Translations)
13-
* [Obfuscate pages](#Obfuscate-pages)
14-
* [Example plugin configuration](#Example-plugin-configuration)
15-
* [Features](#Features)
16-
* [Override default templates](#Override-default-templates)
17-
* [Add button](#Add-button)
18-
* [Tag encrypted page](#Tag-encrypted-page)
19-
* [Remember password](#Remember-password)
20-
* [Modify generated pages](#Modify-generated-pages)
21-
* [Encrypt something](#Encrypt-something)
22-
* [Inject decrypt-form.tpl to theme](#Inject-decrypt-form.tpl-to-theme)
23-
* [Mix encrypted and normal content](#Mix-encrypted-and-normal-content)
24-
* [Search encryption](#Search-encryption)
25-
* [Search index encryption](#Search-index-encryption)
26-
* [Search index encryption for mkdocs-material](#Search-index-encryption-for-mkdocs-material)
27-
* [Javascript extensions](#Javascript-extensions)
28-
* [Reload user-defined scripts](#Reload-user-defined-scripts)
29-
* [HighlightJS support](#HighlightJS-support)
30-
* [Arithmatex support](#Arithmatex-support)
31-
* [Mermaid2 support](#Mermaid2-support)
32-
* [Security](#Security)
33-
* [Crypto-js or webcrypto?](#Crypto-js-or-webcrypto?)
34-
* [File name obfuscation](#File-name-obfuscation)
35-
* [Signing of generated files](#Signing-of-generated-files)
36-
37-
381
[![PyPI Version][pypi-v-image]][pypi-v-link]
392
[![PyPI downloads](https://img.shields.io/pypi/dm/mkdocs-encryptcontent-plugin.svg)](https://pypi.org/project/mkdocs-encryptcontent-plugin)
403
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)'
414

5+
# mkdocs-encryptcontent-plugin
6+
427
This plugin allows you to have password protected articles and pages in MKdocs.
438

449
The content is encrypted with AES-256 in Python using PyCryptodome and decrypted in the browser with Crypto-JS or Webcrypto.
@@ -76,6 +41,41 @@ The content is encrypted with AES-256 in Python using PyCryptodome and decrypted
7641
## Todos for 3.1.x
7742
* optional server side keystore (allows throtteling)
7843
* ...to be defined
44+
45+
46+
# Table of Contents
47+
* [Installation](#Installation)
48+
* [Usage](#Usage)
49+
* [Global password protection](#Global-password-protection)
50+
* [Password inventory](#Password-inventory)
51+
* [Secret from environment](#Secret-from-environment)
52+
* [Default vars customization](#Default-vars-customization)
53+
* [Translations](#Translations)
54+
* [Obfuscate pages](#Obfuscate-pages)
55+
* [Example plugin configuration](#Example-plugin-configuration)
56+
* [Features](#Features)
57+
* [Override default templates](#Override-default-templates)
58+
* [Add button](#Add-button)
59+
* [Tag encrypted page](#Tag-encrypted-page)
60+
* [Remember password](#Remember-password)
61+
* [Modify generated pages](#Modify-generated-pages)
62+
* [Encrypt something](#Encrypt-something)
63+
* [Inject decrypt-form.tpl to theme](#Inject-decrypt-form.tpl-to-theme)
64+
* [Mix encrypted and normal content](#Mix-encrypted-and-normal-content)
65+
* [Search encryption](#Search-encryption)
66+
* [Search index encryption](#Search-index-encryption)
67+
* [Search index encryption for mkdocs-material](#Search-index-encryption-for-mkdocs-material)
68+
* [Javascript extensions](#Javascript-extensions)
69+
* [Reload user-defined scripts](#Reload-user-defined-scripts)
70+
* [HighlightJS support](#HighlightJS-support)
71+
* [Arithmatex support](#Arithmatex-support)
72+
* [Mermaid2 support](#Mermaid2-support)
73+
* [Security](#Security)
74+
* [Crypto-js or webcrypto?](#Crypto-js-or-webcrypto?)
75+
* [File name obfuscation](#File-name-obfuscation)
76+
* [Signing of generated files](#Signing-of-generated-files)
77+
78+
7979
# Installation
8080

8181
Install the package with pip:

documentation/docs/installation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
# Installation
24

35
Install the package with pip:

documentation/hooks.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ def get_external_assets(config, **kwargs):
6767
def create_readme(config, **kwargs):
6868
logger = logging.getLogger("mkdocs.create_readme")
6969
cur_dir = Path(os.path.dirname(os.path.realpath(__file__)))
70-
pypi_md = """
71-
[![PyPI Version][pypi-v-image]][pypi-v-link]
70+
pypi_md = """[![PyPI Version][pypi-v-image]][pypi-v-link]
7271
[![PyPI downloads](https://img.shields.io/pypi/dm/mkdocs-encryptcontent-plugin.svg)](https://pypi.org/project/mkdocs-encryptcontent-plugin)
7372
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)'
73+
7474
"""
7575
readme_file = cur_dir / Path('../README.md')
76+
7677
with open(cur_dir / Path('docs/index.md'), "r") as f:
77-
contents = f.readlines()
78-
contents.insert(1, pypi_md)
79-
readme_md = "".join(contents)
78+
index_md = f.read()
79+
readme_md = ''
8080
with open(cur_dir / Path('docs/installation.md'), "r") as f:
8181
readme_md = readme_md + f.read() + '\n'
8282
with open(cur_dir / Path('docs/usage.md'), "r") as f:
@@ -101,3 +101,8 @@ def create_readme(config, **kwargs):
101101
markdowntoc.main()
102102
except:
103103
logger.error('Please run "pip install markdown-toc"')
104+
105+
with open(readme_file, "r") as f:
106+
readme_md = f.read()
107+
with open(readme_file, "w") as f:
108+
f.write(pypi_md + index_md + readme_md)

0 commit comments

Comments
 (0)