From 69b151a76d00033bc974a499c6bcdfb88f8ed323 Mon Sep 17 00:00:00 2001 From: mmatera Date: Tue, 19 Mar 2024 10:04:53 -0300 Subject: [PATCH] last fixes --- .github/workflows/osx.yaml | 2 +- .github/workflows/ubuntu.yml | 2 +- .github/workflows/windows.yml | 2 +- mathics_django/doc/django_doc.py | 21 ++++++++++++------- mathics_django/web/templates/doc/chapter.html | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/osx.yaml b/.github/workflows/osx.yaml index 6257100bb..3d60387de 100644 --- a/.github/workflows/osx.yaml +++ b/.github/workflows/osx.yaml @@ -30,7 +30,7 @@ jobs: # For testing 3.11 we need to do something like the below until the next Mathics3 is released # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] # python -m pip install -e git+https://github.com/Mathics3/mathics-core#egg=Mathics3[full] - git clone --branch doc-code-rebased-rebased https://github.com/Mathics3/mathics-core + git clone --branch more_docpipeline_fixes_2 https://github.com/Mathics3/mathics-core (cd mathics-core && pip3 install -e .[full]) (cd mathics-core && bash ./admin-tools/make-op-tables.sh) - name: Install Mathics3 Django diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index a38b17ab6..e3c222a26 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -29,7 +29,7 @@ jobs: # For testing 3.11 we need to do something like the below until the next Mathics3 is released # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] # python -m pip install -e git+https://github.com/Mathics3/mathics-core#egg=Mathics3[full] - git clone --branch doc-code-rebased-rebased https://github.com/Mathics3/mathics-core + git clone --branch more_docpipeline_fixes_2 https://github.com/Mathics3/mathics-core (cd mathics-core && pip3 install -e .[full]) (cd mathics-core && bash ./admin-tools/make-op-tables.sh) - name: Install Mathics3 Django diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1aa05578c..70a84b973 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -32,7 +32,7 @@ jobs: # For testing 3.11 we need to do something like the below until the next Mathics3 is released # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] # python -m pip install -e git+https://github.com/Mathics3/mathics-core#egg=Mathics3[full] - git clone --branch doc-code-rebased-rebased https://github.com/Mathics3/mathics-core + git clone --branch more_docpipeline_fixes_2 https://github.com/Mathics3/mathics-core bash -c '(cd mathics-core && pip3 install -e .[full])' bash -c '(cd mathics-core && bash ./admin-tools/make-op-tables.sh)' - name: Install Mathics3 Django diff --git a/mathics_django/doc/django_doc.py b/mathics_django/doc/django_doc.py index 112c33f26..fb4c6eb65 100644 --- a/mathics_django/doc/django_doc.py +++ b/mathics_django/doc/django_doc.py @@ -72,13 +72,7 @@ def get_title_html(self): class DjangoDocumentation(Documentation, DjangoDocElement): def __init__(self): super(DjangoDocumentation, self).__init__() - self.doc_class = DjangoDoc self.doc_dir = settings.DOC_DIR - self.chapter_class = DjangoDocChapter - self.guide_section_class = DjangoDocGuideSection - self.part_class = DjangoDocPart - self.section_class = DjangoDocSection - self.subsection_class = DjangoDocSubsection self.load_documentation_sources() self.doctest_latex_pcl_path = settings.DOCTEST_LATEX_DATA_PCL @@ -88,6 +82,14 @@ def __init__(self): ) self.title = "Overview" + def _set_classes(self): + self.doc_class = DjangoDoc + self.chapter_class = DjangoDocChapter + self.guide_section_class = DjangoDocGuideSection + self.part_class = DjangoDocPart + self.section_class = DjangoDocSection + self.subsection_class = DjangoDocSubsection + def __str__(self): return "\n\n\n".join(str(part) for part in self.parts) @@ -195,7 +197,12 @@ class DjangoDocChapter(DocChapter, DjangoDocElement): """An object for a Django Documentation Chapter. A Chapter is part of a Part and contains Sections. """ - + @property + def guide_or_symbol_sections(self): + if self.guide_sections: + return self.guide_sections + return self.sections + def get_collection(self): """Return a list of chapters in the part of this chapter.""" return self.part.chapters diff --git a/mathics_django/web/templates/doc/chapter.html b/mathics_django/web/templates/doc/chapter.html index 6305faaad..85363a84f 100644 --- a/mathics_django/web/templates/doc/chapter.html +++ b/mathics_django/web/templates/doc/chapter.html @@ -11,7 +11,7 @@ {{ chapter.doc.html }}