Skip to content

Commit

Permalink
last fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatera committed Mar 19, 2024
1 parent c26e0d0 commit 69b151a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/osx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 14 additions & 7 deletions mathics_django/doc/django_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mathics_django/web/templates/doc/chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{ chapter.doc.html }}

<ul>
{% for section in chapter.all_sections %}
{% for section in chapter.guide_or_symbol_sections %}
{% if section.summary_text %}
<li>{{ section|link:ajax }} &mdash; <i>{{section.summary_text}}</i></li>
{% else %}
Expand Down

0 comments on commit 69b151a

Please sign in to comment.