diff --git a/.readthedocs.yaml b/.readthedocs.yaml index ebb9295..2dc6d8d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,3 +14,5 @@ sphinx: python: version: 3.7 system_packages: true + install: + - requirements: sphinx-docs/requirements.txt diff --git a/docs/internal-structure.md b/docs/internal-structure.md index 4a2c622..cc0789e 100644 --- a/docs/internal-structure.md +++ b/docs/internal-structure.md @@ -1,4 +1,4 @@ -# The internal structure of RISCemu +# Internal Structure ## Loading assembly files: In order to load an assembly file, you need to instantiate a CPU with the capabilities you want. Loading an assembly diff --git a/docs/syscalls.md b/docs/syscalls.md index dbc1909..69d8595 100644 --- a/docs/syscalls.md +++ b/docs/syscalls.md @@ -1,4 +1,4 @@ -# Syscalls: +# Syscalls Performing a syscall is quite simple: ```risc-v asm diff --git a/generate-docs.sh b/generate-docs.sh index 511f484..84fb599 100755 --- a/generate-docs.sh +++ b/generate-docs.sh @@ -3,6 +3,7 @@ echo "Generating docs!" + if ! command -v 'sphinx-apidoc'; then source venv/bin/activate pip install sphinx @@ -15,6 +16,10 @@ if [[ $1 == 'generate' ]]; then exit 0 fi +# delete old help folder +rm -rf sphinx-docs/source/help +cp -r docs sphinx-docs/source/help + PYTHONPATH=. sphinx-apidoc -e -f -o sphinx-docs/source riscemu riscemu/colors.py riscemu/__main__.py rm sphinx-docs/source/modules.rst diff --git a/sphinx-docs/.gitignore b/sphinx-docs/.gitignore index 4b8fab5..ab8b79e 100644 --- a/sphinx-docs/.gitignore +++ b/sphinx-docs/.gitignore @@ -1,3 +1,4 @@ build source/riscemu*.rst -source/modules.rst \ No newline at end of file +source/modules.rst +source/help \ No newline at end of file diff --git a/sphinx-docs/requirements.txt b/sphinx-docs/requirements.txt new file mode 100644 index 0000000..2ff3af2 --- /dev/null +++ b/sphinx-docs/requirements.txt @@ -0,0 +1 @@ +recommonmark \ No newline at end of file diff --git a/sphinx-docs/source/conf.py b/sphinx-docs/source/conf.py index a94a5b8..9a5b294 100644 --- a/sphinx-docs/source/conf.py +++ b/sphinx-docs/source/conf.py @@ -21,7 +21,6 @@ import subprocess if os.getenv('READTHEDOCS', False) and not os.path.exists('riscemu.rst'): subprocess.check_call(['../../generate-docs.sh', 'generate']) - # -- Project information ----------------------------------------------------- project = 'RiscEmu' @@ -31,20 +30,20 @@ author = 'Anton Lydike' # The full version, including alpha/beta/rc tags release = '0.1.0' - # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc' + 'sphinx.ext.autodoc', + 'recommonmark' ] # autodoc options autodoc_default_options = { - 'members': True, - 'member-order': 'bysource', + 'members': True, + 'member-order': 'bysource', 'special-members': '__init__', } @@ -54,8 +53,16 @@ templates_path = ['_templates'] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +# Markdown support +from recommonmark.parser import CommonMarkParser + +# The suffix of source filenames. +source_suffix = ['.rst', '.md'] + +source_parsers = { + '.md': CommonMarkParser, +} # -- Options for HTML output ------------------------------------------------- @@ -64,6 +71,8 @@ exclude_patterns = [] # html_theme = 'alabaster' +pygments_style = 'sphinx' + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". @@ -71,7 +80,6 @@ html_static_path = ['_static'] sys.path.insert(0, os.path.abspath('../../')) - if os.getenv('READTHEDOCS', False): import sphinx_rtd_theme diff --git a/sphinx-docs/source/index.rst b/sphinx-docs/source/index.rst index f7c63bf..fea3c32 100644 --- a/sphinx-docs/source/index.rst +++ b/sphinx-docs/source/index.rst @@ -4,15 +4,24 @@ contain the root `toctree` directive. RiscEmu Documentation! -=================================== +====================== Check this project out on github_. .. _github: https://github.com/antonlydike/riscemu +Help: +===== + +.. toctree:: + :maxdepth: 1 + :glob: + + help/* + Package structure: -================= +================== .. toctree:: :maxdepth: 5 @@ -28,3 +37,26 @@ Other links: * :ref:`search` +License: +======== +MIT License + +Copyright (c) 2021 Anton Lydike + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file