Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for mkdocs-encryptcontent-plugin #26

Closed
andynameistaken opened this issue Oct 11, 2021 · 10 comments
Closed

Support for mkdocs-encryptcontent-plugin #26

andynameistaken opened this issue Oct 11, 2021 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@andynameistaken
Copy link

andynameistaken commented Oct 11, 2021

image

mkdocs.yml:

# Project information
site_name: 'Code Vault'
site_description: 'Programming Notes'
site_author: 'Andrzej Zahorski'

# Repository
# repo_name: ''
# repo_url: ''

# Copyright
copyright: 'Copyright © 2021 Andrzej Zahorski'

# Plugins
plugins:
  - markmap
  - search

  # - alternate-link
  # - literate-nav:
      # nav_file: SUMMARY.md
  - roamlinks
  - encryptcontent:
      password_button: True
      password_button_text: 'custome_text_button'

## Extensions
markdown_extensions:
  - footnotes
  - pymdownx.highlight:
      linenums: true           
  - pymdownx.superfences   
  - pymdownx.inlinehilite  
  - pymdownx.keys
  - pymdownx.snippets  
  - admonition
  - pymdownx.details  
  - attr_list





  # - attr_list
  # - pymdownx.arithmatex
  # - pymdownx.details
  # - pymdownx.magiclink
  # - pymdownx.tasklist:
  #     custom_checkbox: true
#  - pymdownx.emoji:
#      emoji_generator: !!python/name:pymdownx.emoji.to_svg
  # - admonition
  - mdx_truly_sane_lists

  - toc:
      permalink: true

# Configuration
theme:
  font:
    text: Sarala
  features:
    - search.suggest    
    - search.highlight     
    - search.share
  
  
  name: 'material'
  language: 'en'
  # logo: 'images/logo.png'
  # favicon: 'images/logo.png'
  palette:
    - media: "(prefers-color-scheme: light)"
      scheme: default
      toggle:
        icon: material/weather-night
        name: Switch to dark mode
    - media: "(prefers-color-scheme: dark)"
      scheme: slate
      accent: orange
      primary: red
      toggle:
        icon: material/weather-sunny
   # Configuration

theme:
  font:
    text: Roboto
  features:
    - search.suggest    
    - search.highlight     
    - search.share
    - navigation.indexes
  name: 'material'
  language: 'en'
  # logo: 'images/logo.png'
  # favicon: 'images/logo.png'
  palette:
    - media: "(prefers-color-scheme: light)"
      scheme: default
      toggle:
        icon: material/weather-night
        name: Switch to dark mode
    - media: "(prefers-color-scheme: dark)"
      scheme: slate
      accent: red
      primary: red
      toggle:
        icon: material/weather-sunny
        name: Switch to light mode
  
  

# Customisation
extra:
  social:
    - icon: fontawesome/brands/github
      link: https://github.com/andynameistaken


extra_css:
  - 'stylesheets/extra.css'

      
nav:
- Java:
    - Java/md-java/index.md
    - Object Oriented Programming: Java/md-java/Object-Oriented-Programming.md
    - Map: mindmap.mm.md

❯ tree docs:

docs
├── Java
│   ├── images
│   │   ├── bicycleObjPaint.png
│   │   ├── concepts-bikeHierarchy.png
│   │   ├── concepts-object.png
│   │   ├── package-tree.png
│   │   └── universe.jpeg
│   └── md-java
│       ├── Object-Oriented-Programming.md
│       └── index.md
├── index.md
├── mindmap.mm.md
└── stylesheets
    └── extra.css

4 directories, 10 files
@neatc0der
Copy link
Member

Hi there,

well, I'm missing an error description here. Simply stating "not working on Python 3.9" doesn't seem plausible, as a recent bug was reported and fixed using Python 3.9.6.

Please elaborate, specifically on the content of your .md files. Also, I appreciate minimalistic samples for bug descriptions 😉

Hint: If you move your mindmaps to .mm.md files, there is no need to annotate using ```markmap.

@andynameistaken
Copy link
Author

andynameistaken commented Oct 14, 2021

Okay, I have to say I was a bit too hasty with my verdict - if I know something does not work I doesn't mean that I understand the problem - I'm sorry it was a bit late when I was writing this issue. I'll checked plugin on minimal config and it is working so problem is somewhere in my .yml.

I've removed everything from pages except custom css and simple index.md, so for now:
index.md:

# Testing

This is a test

```markmap
# Root

## Branch 1

* Branchlet 1a
* Branchlet 1b

## Branch 2

* Branchlet 2a
* Branchlet 2b

mkdocs.yml:

# Project information
site_name: 'Test'
site_description: 'Testing'


# Repository
# repo_name: ''
# repo_url: ''

# Copyright
copyright: 'Copyright © 2021 Testing'

# Plugins
plugins:
  - markmap
  - search
  - autolinks 

  # - alternate-link
  # - literate-nav:
      # nav_file: SUMMARY.md
  - roamlinks
  - encryptcontent:
      global_password: 'test'
      remember_password: True
      decrypt_search: True
      title_prefix: ''






## Extensions
markdown_extensions:    
  - mdx_truly_sane_lists:

  - footnotes
  - pymdownx.highlight:
      linenums: true           
  - pymdownx.superfences   
  - pymdownx.inlinehilite  
  - pymdownx.keys
  - pymdownx.snippets  
  - admonition
  - pymdownx.details  
  - attr_list


  - toc:
      permalink: true

# Configuration
theme:
  font:
    text: Sarala
  features:
    - navigation.top
    - search.suggest    
    - search.highlight     
    - search.share    

  
  
  name: 'material'
  language: 'en'
  # logo: 'images/logo.png'
  # favicon: 'images/logo.png'
  palette:
    - media: "(prefers-color-scheme: light)"
      scheme: default
      toggle:
        icon: material/weather-night
        name: Switch to dark mode
    - media: "(prefers-color-scheme: dark)"
      scheme: slate
      accent: green
      primary: deep purple
      toggle:
        icon: material/weather-sunny
   # Configuration

  
  

# Customisation
extra:
  social:
    - icon: fontawesome/brands/github
      link: https://github.com/andynameistaken
  generator: false


    

extra_css:
  - 'stylesheets/extra.css'

    

Logs:

INFO     -  Building documentation...
INFO     -  Cleaning site directory
INFO     -  no markmap found: index
INFO     -  Documentation built in 0.24 seconds
INFO     -  [17:10:22] Serving on http://127.0.0.1:8000/
INFO     -  [17:10:23] Browser connected: http://127.0.0.1:8000/
INFO     -  [17:10:23] Browser connected: http://127.0.0.1:8000/
INFO     -  [17:10:25] Browser connected: http://127.0.0.1:8000/

@andynameistaken
Copy link
Author

andynameistaken commented Oct 14, 2021

Oh I found the issue! When mkdocs-encryptcontent-plugin is enabled and password is set or superfences plugin is enabled markmap doesn't show up. Not sure why tho. I'll rename the issue title so it will stay relevant to the problem.

@andynameistaken andynameistaken changed the title markmap not working on Python 3.9 markmap doesn't show with mkdocs-encryptcontent-plugin enabled Oct 14, 2021
@andynameistaken andynameistaken changed the title markmap doesn't show with mkdocs-encryptcontent-plugin enabled markmap doesn't show when mkdocs-encryptcontent-plugin or pymdown superfences is enabled Oct 14, 2021
@neatc0der
Copy link
Member

Ok, that's a good starting point. Since #19 concerning superfences was fixed, I need to ask: Which version of pymdownx and markmap are you using?

@andynameistaken
Copy link
Author

andynameistaken commented Oct 14, 2021

pymdown-extensions: 9.0
mkdocs-markmap : 2.1.2

@neatc0der
Copy link
Member

Confirmed: #27

@neatc0der neatc0der changed the title markmap doesn't show when mkdocs-encryptcontent-plugin or pymdown superfences is enabled Doesn't work with mkdocs-encryptcontent-plugin Oct 15, 2021
@andynameistaken
Copy link
Author

andynameistaken commented Oct 15, 2021

Anyway, I wanted to thank you for keeping up this project - it a nice to have it at the index page of every section so people can get grasp what they will be reading about. It would be cool to have some kind of interface for rolling map like admonitions in mkdocs material design theme (or Obsidian Publish graph view) so map would not take up unnecessary space, but it is still neat at its current feature set.

@neatc0der
Copy link
Member

neatc0der commented Oct 16, 2021

Ok, so I identified the issue with mkdocs-encryptcontent-plugin, which actually screws a lot with the processes of this project:

  • It alters page content on an earlier hook than this project. (easy to fix)
  • After decryption no generic event is triggered, which leaves this project with the need for an observer. (more difficult...)

Thus, I'll view this issue as a feature request. Also, this may take a bit since highlight will need to be supported, but I'm not willing to add it as dependency. I'll keep you posted.

@neatc0der neatc0der changed the title Doesn't work with mkdocs-encryptcontent-plugin Support for mkdocs-encryptcontent-plugin Oct 16, 2021
@neatc0der neatc0der self-assigned this Oct 16, 2021
@neatc0der neatc0der added the enhancement New feature or request label Oct 16, 2021
@neatc0der
Copy link
Member

v2.2.0 released

@neatc0der
Copy link
Member

Anyway, I wanted to thank you for keeping up this project - it a nice to have it at the index page of every section so people can get grasp what they will be reading about. It would be cool to have some kind of interface for rolling map like admonitions in mkdocs material design theme (or Obsidian Publish graph view) so map would not take up unnecessary space, but it is still neat at its current feature set.

@andynameistaken Thanks. Concerning your suggestions, markmap might be a better place to submit them. mkdocs-markmap is a project merely focused on the integration of markmap for mkdocs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants