Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added section about stub anatomy * Added first version of MkDocs documentation for use in frontend site * Updated sync doc script to strip table of contents * Also copy changelog * Added readthedocs theme * Added favicon to docs * Removed old docs * Added build step for MkDocs * Updated .gitignore * Test * Fix in doc build script * Move docs to correct place in UI project * Fixed bug in doc sync script * Fixes in build scripts * Re-enable tests * Added api docs to menu * Small doc fixes * Added logo in docs * Added meta description * Updated CHANGELOG * Pack docs as artifact * Small change in .gitlab-ci.yml * Fixed build scripts Co-authored-by: Duco <git@ducode.org>
- Loading branch information
1 parent
da46b94
commit 1f5ba37
Showing
22 changed files
with
249 additions
and
177 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
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,2 @@ | ||
docs/ | ||
site/ |
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,3 @@ | ||
site_name: HttPlaceholder documentation | ||
theme: readthedocs | ||
site_description: HttPlaceholder documentation - Quickly stub away any HTTP service |
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,62 @@ | ||
import os | ||
import shutil | ||
import re | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
mkdocs_docs_path = os.path.join(dir_path, 'docs') | ||
|
||
# Create mkdocs docs folder if it doesn't exist yet. | ||
if not os.path.isdir(mkdocs_docs_path): | ||
os.mkdir(mkdocs_docs_path) | ||
|
||
# Copy index.md to the correct location. | ||
docs_md_path = os.path.join(dir_path, '..', 'docs.md') | ||
docs_md_copy_path = os.path.join(mkdocs_docs_path, 'index.md') | ||
shutil.copyfile(docs_md_path, docs_md_copy_path) | ||
|
||
# Copy CHANGELOG file | ||
changelog_path = os.path.join(dir_path, '..', '..', 'CHANGELOG') | ||
changelog_path_copy_path = os.path.join(mkdocs_docs_path, 'CHANGELOG') | ||
shutil.copyfile(changelog_path, changelog_path_copy_path) | ||
|
||
# Remove table of contents from copied file. | ||
docs_md_file_read = open(docs_md_copy_path) | ||
lines = docs_md_file_read.readlines() | ||
docs_md_file_read.close() | ||
lines_result = [] | ||
add_line = False | ||
for line in lines: | ||
if line.startswith('# Installation'): | ||
add_line = True | ||
if add_line: | ||
lines_result.append(line.rstrip('\n')) | ||
|
||
docs_md = '\n'.join(lines_result) | ||
|
||
|
||
def re_replace(find, replace, input): | ||
return re.sub(find, replace, input, flags=re.M) | ||
|
||
|
||
docs_md = re_replace('^#### ', '##### ', docs_md) | ||
docs_md = re_replace('^### ', '#### ', docs_md) | ||
docs_md = re_replace('^## ', '### ', docs_md) | ||
docs_md = re_replace('^# ', '## ', docs_md) | ||
docs_md = '![](img/logo.png)\n\n' + docs_md | ||
docs_md_file_write = open(docs_md_copy_path, 'w') | ||
docs_md_file_write.write(docs_md) | ||
docs_md_file_write.close() | ||
|
||
# Copy img folder | ||
img_path = os.path.join(dir_path, '..', 'img') | ||
img_copy_path = os.path.join(mkdocs_docs_path, 'img') | ||
if os.path.isdir(img_copy_path): | ||
shutil.rmtree(img_copy_path) | ||
shutil.copytree(img_path, img_copy_path) | ||
|
||
# Copy samples folder | ||
samples_path = os.path.join(dir_path, '..', 'samples') | ||
samples_copy_path = os.path.join(mkdocs_docs_path, 'samples') | ||
if os.path.isdir(samples_copy_path): | ||
shutil.rmtree(samples_copy_path) | ||
shutil.copytree(samples_path, samples_copy_path) |
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.