mirror of
https://github.com/Cian-H/I-Form_Research_Server_Docs.git
synced 2025-12-22 14:12:01 +00:00
first commit
This commit is contained in:
159
.gitignore
vendored
Normal file
159
.gitignore
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
cover/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Ruff stuff:
|
||||
.ruff_cache
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
.pybuilder/
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# pyenv
|
||||
# For a library or package, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# .python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# poetry
|
||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly ignored for libraries.
|
||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||
poetry.lock
|
||||
|
||||
# pdm
|
||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||
#pdm.lock
|
||||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
||||
# in version control.
|
||||
# https://pdm.fming.dev/#use-with-ide
|
||||
.pdm.toml
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
celerybeat-schedule
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# VSCode project settings
|
||||
.vscode/
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
# pytype static type analyzer
|
||||
.pytype/
|
||||
|
||||
# Cython debug symbols
|
||||
cython_debug/
|
||||
7
LICENSE
Normal file
7
LICENSE
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright 2023 Cian Hughes
|
||||
|
||||
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.
|
||||
11
README.md
Normal file
11
README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
##
|
||||
|
||||
# Research Server Documentation
|
||||
|
||||
[link_test](https://i-form-node-deployer.netlify.app)
|
||||
|
||||
## Usage
|
||||
|
||||
# Usage
|
||||
37
build.py
Normal file
37
build.py
Normal file
@@ -0,0 +1,37 @@
|
||||
import subprocess
|
||||
|
||||
import tomlkit as toml
|
||||
|
||||
from scripts_config import readme_files # type: ignore
|
||||
|
||||
def create_readme():
|
||||
with open("README.md", "wt") as r:
|
||||
for header, file in readme_files.items():
|
||||
r.write(f"\n\n## {header}\n\n")
|
||||
with open(file, "rt") as f:
|
||||
r.write(f.read())
|
||||
|
||||
|
||||
def update_license():
|
||||
with open("LICENSE", "rt") as source, open("docs/license.md", "wt") as target:
|
||||
target.write(source.read())
|
||||
|
||||
|
||||
def build_docs():
|
||||
print("Building docs...")
|
||||
# First, ensure the license is up to date
|
||||
update_license()
|
||||
# Then, we build the docs
|
||||
subprocess.run(["poetry", "run", "mkdocs", "build", "--clean"])
|
||||
# Finally, export the readme
|
||||
print("Exporting readme...")
|
||||
create_readme()
|
||||
print("Finished building docs.")
|
||||
|
||||
|
||||
def main():
|
||||
build_docs()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
BIN
docs/assets/favicon.ico
Normal file
BIN
docs/assets/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 114 KiB |
BIN
docs/assets/logo.png
Normal file
BIN
docs/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
3
docs/index.md
Normal file
3
docs/index.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Research Server Documentation
|
||||
|
||||
[link_test](https://i-form-node-deployer.netlify.app)
|
||||
7
docs/license.md
Normal file
7
docs/license.md
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright 2023 Cian Hughes
|
||||
|
||||
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.
|
||||
1
docs/usage.md
Normal file
1
docs/usage.md
Normal file
@@ -0,0 +1 @@
|
||||
# Usage
|
||||
50
mkdocs.yaml
Normal file
50
mkdocs.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
site_name: I-Form Research Server Documentation
|
||||
repo_url: https://github.com/Cian-H/I-Form_Research_Server_Docs
|
||||
repo_name: Cian-H/I-Form_Research_Server_Docs
|
||||
edit_uri: edit/main/docs/
|
||||
docs_dir: docs
|
||||
site_dir: site
|
||||
|
||||
theme:
|
||||
name: material
|
||||
logo: assets/logo.png
|
||||
favicon: assets/favicon.ico
|
||||
icon:
|
||||
repo: fontawesome/brands/github-alt
|
||||
palette:
|
||||
# Palette toggle for light mode
|
||||
- scheme: default
|
||||
accent: teal
|
||||
toggle:
|
||||
icon: material/lightbulb
|
||||
name: Switch to dark mode
|
||||
# Palette toggle for dark mode
|
||||
- scheme: slate
|
||||
accent: teal
|
||||
toggle:
|
||||
icon: material/lightbulb-outline
|
||||
name: Switch to light mode
|
||||
|
||||
nav:
|
||||
- Home: index.md
|
||||
- Getting Started:
|
||||
- Usage: usage.md
|
||||
- Reference:
|
||||
# - FAQ: faq.md
|
||||
# - Troubleshooting: troubleshooting.md
|
||||
# - Changelog: changelog.md
|
||||
- License: license.md
|
||||
|
||||
extra:
|
||||
version:
|
||||
provider: mike
|
||||
|
||||
plugins:
|
||||
#TODO: Add plugins, they seem to be broken at the moment
|
||||
# - material/optimize
|
||||
# - material/privacy
|
||||
# - material/projects
|
||||
# - material/typeset
|
||||
- search
|
||||
# - git-revision-date-localized:
|
||||
# enable_creation_date: true
|
||||
30
pyproject copy.toml
Normal file
30
pyproject copy.toml
Normal file
@@ -0,0 +1,30 @@
|
||||
[tool.poetry]
|
||||
name = "research-server-docs"
|
||||
version = "0.1.0"
|
||||
description = "Documentation for the I-Form Research Server system"
|
||||
authors = ["Cian Hughes <cian.hughes@dcu.ie>"]
|
||||
readme = "README.md"
|
||||
license = "MIT"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.12,<4.0"
|
||||
i-form-server-node-deployer = {git = "https://github.com/Cian-H/I-Form_Server_Node_Deployer"}
|
||||
mkdocs = "^1.5.3"
|
||||
tomlkit = "^0.12.2"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
build = "build:main"
|
||||
|
||||
[tool.scripts-config]
|
||||
node_deployer_src = "{$VIRTUAL_ENV}/src/I-Form_Server_Node_Deployer"
|
||||
|
||||
[tool.scripts-config.readme_files]
|
||||
"" = "docs/index.md"
|
||||
"Usage" = "docs/usage.md"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.black]
|
||||
line-length = 100
|
||||
30
pyproject.toml
Normal file
30
pyproject.toml
Normal file
@@ -0,0 +1,30 @@
|
||||
[tool.poetry]
|
||||
name = "research-server-docs"
|
||||
version = "0.1.0"
|
||||
description = "Documentation for the I-Form Research Server system"
|
||||
authors = ["Cian Hughes <cian.hughes@dcu.ie>"]
|
||||
readme = "README.md"
|
||||
license = "MIT"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.8,<4.0"
|
||||
mkdocs = "^1.5.3"
|
||||
mkdocs-material = "^9.4.8"
|
||||
tomlkit = "^0.12.2"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
build = "build:main"
|
||||
|
||||
[tool.scripts-config]
|
||||
virtual_env = "{$VIRTUAL_ENV}/src/I-Form_Server_Node_Deployer"
|
||||
|
||||
[tool.scripts-config.readme_files]
|
||||
"" = "docs/index.md"
|
||||
"Usage" = "docs/usage.md"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.black]
|
||||
line-length = 100
|
||||
46
scripts_config.py
Normal file
46
scripts_config.py
Normal file
@@ -0,0 +1,46 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import tomlkit as toml
|
||||
|
||||
|
||||
VIRTUAL_ENV = Path(os.environ.get("VIRTUAL_ENV", ".venv"))
|
||||
|
||||
|
||||
def insert_env_vars(split_config):
|
||||
"""
|
||||
Inserts environment variables into the config file
|
||||
where they follow the format {$ENV_VAR_NAME}
|
||||
"""
|
||||
config_str = toml.dumps(split_config)
|
||||
split_config = config_str.split("{$")
|
||||
if len(split_config) > 1:
|
||||
c_head = split_config[0]
|
||||
c_tail = split_config[1:]
|
||||
c_parsed_tail = [
|
||||
"".join((os.environ[x0], x1)) for x0, x1 in
|
||||
(
|
||||
(y[:i], y[i+1:]) for i, y in
|
||||
zip(
|
||||
(z.find("}") for z in c_tail),
|
||||
c_tail
|
||||
)
|
||||
)
|
||||
]
|
||||
config_str = "".join((c_head, *c_parsed_tail))
|
||||
return toml.loads(config_str)
|
||||
|
||||
|
||||
def parse_config():
|
||||
with open("pyproject.toml", "rt") as f:
|
||||
config = toml.load(f)["tool"]["scripts-config"]
|
||||
config = insert_env_vars(config)
|
||||
return config
|
||||
|
||||
|
||||
def init():
|
||||
config = parse_config()
|
||||
globals().update(config)
|
||||
|
||||
|
||||
init()
|
||||
3
src/research_server_docs.py
Normal file
3
src/research_server_docs.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""
|
||||
This is a dummy file so that we can use poetry as the build system for these docs.
|
||||
"""
|
||||
Reference in New Issue
Block a user