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
@@ -214,8 +214,10 @@ Child elements of `encrypted_something` are build with a key `<unique name>` in
214
214
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.
215
215
216
216
```yaml
217
-
encrypted_something:
218
-
<uniq name>: [<html tag>, <'class' or 'id'>]
217
+
plugins:
218
+
- encryptcontent:
219
+
encrypted_something:
220
+
<uniq name>: [<html tag>, <'class' or 'id'>]
219
221
```
220
222
221
223
The `<unique name>` key identifies the name of a specific element of the page that will be searched by beautifulSoup.
@@ -250,8 +252,10 @@ Then add these elements in the format of a yaml dictionary under the variable `e
250
252
Set your configuration like this :
251
253
252
254
```yaml
253
-
encrypted_something:
254
-
mkdocs-encrypted-toc: [div, id]
255
+
plugins:
256
+
- encryptcontent:
257
+
encrypted_something:
258
+
mkdocs-encrypted-toc: [div, id]
255
259
```
256
260
257
261
2. Other example, with multiples target. In you Material Theme, you want to encrypt ToC content and Footer.
@@ -275,10 +279,12 @@ After modification, your template looks like this :
275
279
276
280
Your configuration like this :
277
281
```yaml
278
-
encrypted_something:
279
-
mkdocs-encrypted-toc: [nav, class]
280
-
mkdocs-encrypted-footer: [div, id]
281
-
mkdocs-encrypted-footer-meta: [div, id]
282
+
plugins:
283
+
- encryptcontent:
284
+
encrypted_something:
285
+
mkdocs-encrypted-toc: [nav, class]
286
+
mkdocs-encrypted-footer: [div, id]
287
+
mkdocs-encrypted-footer-meta: [div, id]
282
288
```
283
289
284
290
@@ -305,6 +311,28 @@ It becomes possible again to make searches on all the pages, even if the content
305
311
If you still want to protect some pages, even though the search index is not encrypted, you can use [mkdocs-exclude-search](https://github.com/chrieke/mkdocs-exclude-search) to exclude parts or complete articles from the search index.
306
312
307
313
314
+
### Reload scripts
315
+
316
+
Related to [issue #14](https://github.com/CoinK0in/mkdocs-encryptcontent-plugin/issues/14)
317
+
318
+
You can set `reload_scripts:` in your `mkdocs.yml` with list of script source, to reload and execute some js lib after decryption process.
319
+
320
+
```yaml
321
+
plugins:
322
+
reload_scripts:
323
+
- "./js/example.js"
324
+
```
325
+
326
+
This feature use the following JQuery function to remove, add and reload javascripts.
327
+
328
+
```javascript
329
+
var reload_js = function(src) {
330
+
$('script[src="' + src + '"]').remove();
331
+
$('<script>').attr('src', src).appendTo('head');
332
+
};
333
+
```
334
+
335
+
308
336
## Contributing
309
337
310
338
From reporting a bug to submitting a pull request: every contribution is appreciated and welcome.
0 commit comments