Skip to content

Commit

Permalink
added sphinx extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
alkidbaci committed Mar 5, 2024
1 parent 4b4df01 commit 62d0036
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 13 deletions.
52 changes: 51 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@
extensions = ["autoapi.extension",
"sphinx.ext.githubpages",
"sphinx.ext.todo",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.autodoc"]
"sphinx.ext.autodoc",
"sphinxcontrib.plantuml",
"myst_parser",
"sphinx_rtd_theme",
]

# autoapi for dicee.
autoapi_dirs = ['../dicee']
Expand All @@ -35,14 +40,56 @@
# this is set to false, so we can add it manually in index.rst together with the other .md files of the documentation.
autoapi_add_toctree_entry = False

inheritance_graph_attrs = dict(rankdir="TB")

myst_enable_extensions = [
'colon_fence',
'deflist',
]

myst_heading_anchors = 3

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

pygments_style = 'rainbow_dash'

plantuml_output_format = 'svg_img'
plantuml_latex_output_format = 'pdf'

stanford_theme_mod = True
html_theme_options = {
'navigation_depth': 6,
}

html_static_path = ['_static']

if stanford_theme_mod:
html_theme = 'sphinx_rtd_theme'

def _import_theme():
import os
import shutil
import sphinx_theme
html_theme = 'stanford_theme'
for _type in ['fonts']:
shutil.copytree(
os.path.join(sphinx_theme.get_html_theme_path(html_theme),
html_theme, 'static', _type),
os.path.join('_static_gen', _type),
dirs_exist_ok=True)
shutil.copy2(
os.path.join(sphinx_theme.get_html_theme_path(html_theme),
html_theme, 'static', 'css', 'theme.css'),
os.path.join('_static_gen', 'theme.css'),
)

_import_theme()
html_static_path = ['_static_gen'] + html_static_path

# -- Options for LaTeX output ------------------------------------------------

latex_engine = 'xelatex'
Expand All @@ -62,4 +109,7 @@

def setup(app):
# -- Options for HTML output ---------------------------------------------
if stanford_theme_mod:
app.add_css_file('theme.css')
app.add_css_file('theme_tweak.css')
app.add_css_file('pygments.css')
10 changes: 2 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to DICE Embeddings documentation!
Welcome to DICE Embeddings!
===========================================

`DICE Embeddings <https://github.com/dice-group/dice-embeddings>`_: Hardware-agnostic Framework for Large-scale Knowledge Graph Embeddings:
=======


.. toctree::
:maxdepth: 2
Expand All @@ -16,9 +16,3 @@ Welcome to DICE Embeddings documentation!
usage/main
autoapi/dicee/index

Indices and tables
-------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
4 changes: 1 addition & 3 deletions docs/usage/main.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Dice Embeddings!
## Dicee Manual

**Version:** dicee 0.1.3.2

Expand Down Expand Up @@ -313,8 +313,6 @@ from dicee import KGE
KGE(path='...').deploy(share=True,top_k=10)
```

<img src="dicee/lp.png" alt="Italian Trulli">

## Docker
To build the Docker image:
```
Expand Down
7 changes: 6 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ rdflib>=7.0.0
tiktoken>=0.5.1
matplotlib>=3.8.2
sphinx-autoapi>=3.0.0
sphinx>=7.2.6
sphinx>=7.2.6
myst-parser>=2.0.0
sphinx_rtd_theme>=2.0.0
sphinx-theme>=1.0
sphinxcontrib-plantuml>=0.27
plantuml-local-client>=1.2022.6

0 comments on commit 62d0036

Please sign in to comment.