-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new CLI command "nbdev mkdocs readme" (#206)
* WIP * Add new command for generating readme * Polish tests * Polish tests * Assign default value if the docs_versioning variable is not set in the settings.ini file --------- Co-authored-by: Sean Bartik <[email protected]>
- Loading branch information
1 parent
cc24eda
commit 49f7a31
Showing
13 changed files
with
675 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.6.0" | ||
__version__ = "0.7.0rc0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/CLI_Docs_Generator.ipynb. | ||
|
||
# %% auto 0 | ||
__all__ = ['update_readme'] | ||
|
||
# %% ../../nbs/CLI_Docs_Generator.ipynb 1 | ||
from typing import * | ||
|
||
from nbdev.quarto import nbdev_readme | ||
from nbdev.config import get_config | ||
from nbdev.doclinks import NbdevLookup | ||
|
||
from .._helpers.doc_links_utils import fix_sym_links | ||
|
||
# %% ../../nbs/CLI_Docs_Generator.ipynb 5 | ||
def update_readme() -> None: | ||
"""Update the readme file and fix the symbol links""" | ||
cfg = get_config() | ||
readme_path = cfg.config_path / "README.md" | ||
nbdev_readme.__wrapped__() | ||
|
||
with open(readme_path, "r", encoding="utf-8") as f: | ||
contents = f.read() | ||
|
||
contents = fix_sym_links( | ||
s=contents, | ||
nbdev_lookup=NbdevLookup(incl_libs=cfg.lib_name.replace("_", "-")), | ||
docs_versioning=cfg.get("docs_versioning", ""), | ||
lib_version=cfg.version, | ||
use_relative_doc_links=False, | ||
use_latest_doc_version=True, | ||
) | ||
|
||
with open(readme_path, "w", encoding="utf-8") as f: | ||
f.write(contents) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.