You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-9Lines changed: 37 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -237,8 +237,10 @@ Child elements of `encrypted_something` are build with a key `<unique name>` in
237
237
The list have to be contructed with the name of an HTML element `<html tag>` as first item and `id` or `class` as the second item.
238
238
239
239
```yaml
240
-
encrypted_something:
241
-
<uniq name>: [<html tag>, <'class' or 'id'>]
240
+
plugins:
241
+
- encryptcontent:
242
+
encrypted_something:
243
+
<uniq name>: [<html tag>, <'class' or 'id'>]
242
244
```
243
245
244
246
The `<unique name>` key identifies the name of a specific element of the page that will be searched by beautifulSoup.
@@ -273,8 +275,10 @@ Then add these elements in the format of a yaml dictionary under the variable `e
273
275
Set your configuration like this :
274
276
275
277
```yaml
276
-
encrypted_something:
277
-
mkdocs-encrypted-toc: [div, id]
278
+
plugins:
279
+
- encryptcontent:
280
+
encrypted_something:
281
+
mkdocs-encrypted-toc: [div, id]
278
282
```
279
283
280
284
2. Other example, with multiples target. In you Material Theme, you want to encrypt ToC content and Footer.
@@ -298,16 +302,18 @@ After modification, your template looks like this :
298
302
299
303
Your configuration like this :
300
304
```yaml
301
-
encrypted_something:
302
-
mkdocs-encrypted-toc: [nav, class]
303
-
mkdocs-encrypted-footer: [div, id]
304
-
mkdocs-encrypted-footer-meta: [div, id]
305
+
plugins:
306
+
- encryptcontent:
307
+
encrypted_something:
308
+
mkdocs-encrypted-toc: [nav, class]
309
+
mkdocs-encrypted-footer: [div, id]
310
+
mkdocs-encrypted-footer-meta: [div, id]
305
311
```
306
312
307
313
308
314
### Search index encryption
309
315
310
-
> **ALPHA VERSION**, use at your own risks. ONLY work with themes using default mkdocs search.
316
+
> **ALPHA VERSION**, use at your own risks. **ONLY** work with themes using default mkdocs search.
311
317
312
318
Related to [issue #13](https://github.com/CoinK0in/mkdocs-encryptcontent-plugin/issues/13)
313
319
@@ -338,6 +344,28 @@ This functionality overwrite the index creation function of the “search” plu
338
344
When the configuration mode is set to "**dynamically**", the javascripts contrib files of the default search plugin are also overloaded to include a process for decrypting and keeping the search index.
339
345
340
346
347
+
### Reload scripts
348
+
349
+
Related to [issue #14](https://github.com/CoinK0in/mkdocs-encryptcontent-plugin/issues/14)
350
+
351
+
You can set `reload_scripts:` in your `mkdocs.yml` with list of script source, to reload and execute some js lib after decryption process.
352
+
353
+
```yaml
354
+
plugins:
355
+
reload_scripts:
356
+
- "./js/example.js"
357
+
```
358
+
359
+
This feature use the following JQuery function to remove, add and reload javascripts.
360
+
361
+
```javascript
362
+
var reload_js = function(src) {
363
+
$('script[src="' + src + '"]').remove();
364
+
$('<script>').attr('src', src).appendTo('head');
365
+
};
366
+
```
367
+
368
+
341
369
# Contributing
342
370
343
371
From reporting a bug to submitting a pull request: every contribution is appreciated and welcome.
0 commit comments