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

Feature request: Allow for adding additional message between summary and password #10

Closed
martinbira opened this issue Aug 17, 2020 · 3 comments
Assignees

Comments

@martinbira
Copy link

The summary as defined in mkdocs.yml is the only way (apart from the password placeholder) on a protected page to convey a message when not logged in. As the summary replaces the <h1> tag when not logged in, leaving additional information there, such as on how to obtain a password, may look extremely bulky .

Proposition:
Allow for a configurable message to be placed within a <p> element inbetween the <h1> and the password input.

Suggested configuration:

- encryptcontent:
        message: 'Contact Support for access to this page.'

Visualisation of result:
5-additional-message

@CoinK0in
Copy link
Collaborator

I add an additional information message in the extra variables.
Check README here

The changes are made in this commit: d2635a3

@CoinK0in CoinK0in self-assigned this Aug 17, 2020
@martinbira
Copy link
Author

I just gave the install a test and when starting up MkDocs it fails due to lack of BeautifulSoup, see error message below. After manually install it it runs. Perhaps it should be installed as a dependecy.

However, even though the new encryption_info_message works fine, the css_class is only applied once I'm at the locked page, not before. The prefix is still there all the time though.

PS C:\MkDocs> mkdocs serve
INFO    -  Building documentation...
Traceback (most recent call last):
  File "c:\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python\Python38\Scripts\mkdocs.exe\__main__.py", line 9, in <module>
  File "c:\python\python38\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\python\python38\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\python\python38\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python\python38\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python\python38\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\python\python38\lib\site-packages\mkdocs\__main__.py", line 133, in serve_command
    serve.serve(
  File "c:\python\python38\lib\site-packages\mkdocs\commands\serve.py", line 141, in serve
    config = builder()
  File "c:\python\python38\lib\site-packages\mkdocs\commands\serve.py", line 122, in builder
    config = load_config(
  File "c:\python\python38\lib\site-packages\mkdocs\config\base.py", line 197, in load_config
    errors, warnings = cfg.validate()
  File "c:\python\python38\lib\site-packages\mkdocs\config\base.py", line 107, in validate
    run_failed, run_warnings = self._validate()
  File "c:\python\python38\lib\site-packages\mkdocs\config\base.py", line 62, in _validate
    self[key] = config_option.validate(value)
  File "c:\python\python38\lib\site-packages\mkdocs\config\config_options.py", line 131, in validate
    return self.run_validation(value)
  File "c:\python\python38\lib\site-packages\mkdocs\config\config_options.py", line 609, in run_validation
    plgins[item] = self.load_plugin(item, cfg)
  File "c:\python\python38\lib\site-packages\mkdocs\config\config_options.py", line 617, in load_plugin
    Plugin = self.installed_plugins[name].load()
  File "c:\python\python38\lib\site-packages\pkg_resources\__init__.py", line 2443, in load
    return self.resolve()
  File "c:\python\python38\lib\site-packages\pkg_resources\__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "c:\python\python38\lib\site-packages\encryptcontent\plugin.py", line 11, in <module>
    from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'

@CoinK0in
Copy link
Collaborator

I fix BS4 requirement.
Please use issue #7 for css class problem.

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

No branches or pull requests

2 participants