git-authors Plugin einrichten #7

Closed
opened 2020-02-15 12:23:40 +00:00 by liska · 2 comments
Owner

Das Plugin git-authors (https://github.com/timvink/mkdocs-git-authors-plugin) ist genau, was wir wollen, um die Mitwirkung weiterer Autoren zu "belohnen" (Anzeige aller Namen in der Fußzeile).

Es funktioniert aber nicht. Die Fehlermeldung

Traceback (most recent call last):
  File "/home/uliska/.local/bin/mkdocs", line 10, in <module>
    sys.exit(cli())
  File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/__main__.py", line 162, in build_command
    site_dir=site_dir
  File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/base.py", line 197, in load_config
    errors, warnings = cfg.validate()
  File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/base.py", line 107, in validate
    run_failed, run_warnings = self._validate()
  File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/base.py", line 62, in _validate
    self[key] = config_option.validate(value)
  File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/config_options.py", line 132, in validate
    return self.run_validation(value)
  File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/config_options.py", line 572, in run_validation
    plgins[item] = self.load_plugin(item, cfg)
  File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/config_options.py", line 587, in load_plugin
    plugin = Plugin()
  File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs_git_authors_plugin/plugin.py", line 12, in __init__
    self.util = Util()
  File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs_git_authors_plugin/util.py", line 7, in __init__
    self.repo = Repo(path)
  File "/home/uliska/.local/lib/python3.7/site-packages/git/repo/base.py", line 184, in __init__
    raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: /home/uliska/git/mhs/glarean-books/books/elearning

scheint mir darauf hinzudeuten, dass der Algorithmus des Plugins, um ein Git-Repository zu entdecken, entweder als solcher zu naiv ist, oder zumindest im Kontext von mkdocs-library zu funktionieren (wo das Buch-Verzeichnis nicht das Repository-Wurzelverzeichnis ist).

Das Plugin `git-authors` (https://github.com/timvink/mkdocs-git-authors-plugin) ist genau, was wir wollen, um die Mitwirkung weiterer Autoren zu "belohnen" (Anzeige aller Namen in der Fußzeile). Es funktioniert aber nicht. Die Fehlermeldung ``` Traceback (most recent call last): File "/home/uliska/.local/bin/mkdocs", line 10, in <module> sys.exit(cli()) File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/uliska/.local/lib/python3.7/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/__main__.py", line 162, in build_command site_dir=site_dir File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/base.py", line 197, in load_config errors, warnings = cfg.validate() File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/base.py", line 107, in validate run_failed, run_warnings = self._validate() File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/base.py", line 62, in _validate self[key] = config_option.validate(value) File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/config_options.py", line 132, in validate return self.run_validation(value) File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/config_options.py", line 572, in run_validation plgins[item] = self.load_plugin(item, cfg) File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs/config/config_options.py", line 587, in load_plugin plugin = Plugin() File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs_git_authors_plugin/plugin.py", line 12, in __init__ self.util = Util() File "/home/uliska/.local/lib/python3.7/site-packages/mkdocs_git_authors_plugin/util.py", line 7, in __init__ self.repo = Repo(path) File "/home/uliska/.local/lib/python3.7/site-packages/git/repo/base.py", line 184, in __init__ raise InvalidGitRepositoryError(epath) git.exc.InvalidGitRepositoryError: /home/uliska/git/mhs/glarean-books/books/elearning ``` scheint mir darauf hinzudeuten, dass der Algorithmus des Plugins, um ein Git-Repository zu entdecken, entweder als solcher zu naiv ist, oder zumindest im Kontext von mkdocs-library zu funktionieren (wo das Buch-Verzeichnis nicht das Repository-Wurzelverzeichnis ist).
Author
Owner

ACHTUNG: Ich habe das absolut HACKY geregelt.

Das Problem ist, dass das Plugin '.' als Repository-Pfad unterstellt, was in unserem Fall nicht gegeben ist.
Ich habe das Plugin lokal installiert. Sinnvoll wäre vermutlich:

  • Forken
  • Fix auf separatem Branch
  • Installation von Github und dem Branch
  • Dokumentieren

ACHTUNG (2):

Ich habe git-authors integriert, indem ich die base.html des Material-Themas verändert habe, um einen neuen git block zu bekommen, den ich in main.html überschreiben kann. Diese base.html scheint schon anders zu sein als im Github repository von Material (ich habe sie aus der pip3-Installation kopiert. => Das heißt, dass es wohl ziemlich problematisch werden könnte, wenn Material auf PyPi aktualisiert wird. Resultat ist ein zerschossenes Stylesheet.

ACHTUNG: Ich habe das absolut HACKY geregelt. Das Problem ist, dass das Plugin `'.'` als Repository-Pfad unterstellt, was in unserem Fall nicht gegeben ist. Ich habe das Plugin lokal installiert. Sinnvoll wäre vermutlich: * Forken * Fix auf separatem Branch * Installation von Github und dem Branch * Dokumentieren ACHTUNG (2): Ich habe git-authors integriert, indem ich die `base.html` des Material-Themas verändert habe, um einen neuen `git` block zu bekommen, den ich in `main.html` überschreiben kann. Diese base.html scheint schon anders zu sein als im Github repository von Material (ich habe sie aus der pip3-Installation kopiert. => Das heißt, dass es wohl ziemlich problematisch werden könnte, wenn Material auf PyPi aktualisiert wird. Resultat ist ein zerschossenes Stylesheet.
Author
Owner

Erledigt (und viel mehr dazugekommen ;-) )

Erledigt (und viel mehr dazugekommen ;-) )
liska closed this issue 2020-03-03 12:28:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: GLAREAN-Doku/glarean-books#7
No description provided.