Package: anarchy-sphinx
ContentsInstallationVia packageVia git or downloadChangelog0.3.1:0.3.0:0.2.0:Swift auto documentation extractorManual documentation for Swift typesanarchysphinxcommand line toolGenerate Dash docsets with sphinxThis is a simplistic theme used for the AnarchyTools Swift documentation.InstallationVia packageDownload the package or add it to yourrequirements.txtfile:$pipinstallanarchy-sphinxIn yourconf.pyfile:# documentation extractor and swift specific commandsextensions=["swift_domain"]# anarchy themeimportanarchy_themehtml_theme="anarchy_theme"html_theme_path=[anarchy_theme.get_html_theme_path()]Via git or downloadSymlink or subtree theanarchy_sphinx/anarchy_themerepository into your documentation atdocs/_themes/anarchy_themeandanarchy_sphinx/swift_domaintodocs/_extensions/swift_domainthen add the following two settings to your Sphinx conf.py file:# documentation extractor and swift specific commandsimportosimportsyssys.path.insert(0,os.path.abspath('_extensions'))extensions=["swift_domain"]# anarchy themehtml_theme="anarchy_theme"html_theme_path=["_themes",]Changelog0.3.1:Fix layout when no sidebar enabledExperimental: Generate anchors likedoc2dashexpects them. Tell me if something breaks!0.3.0:Fix table rendering in themeMake code boxes that overflow scrollableSwitch to bold style for active toc itemsBugfix: right aligned images were left alignedAdd bullets in front of nav items on top-bar to distinguish them0.2.0:Addanarchysphinxcommand line tool to bootstrap documentationSwift auto documentation extractorIf you want to use the doc-string extractor for Swift you’ll need to inform Sphinx about
where you keep your*.swiftfiles.swift_search_path=["../src"]If you’ve set that up you can use.. autoswift:: <symbol>to let the documenter search
for a Swift symbol and import the documentation in place.You may set some flags to configure documentation behaviour::noindex:do not add to index:noindex-members:do not index members:members:document members, optional: list of members to include:recursive-members:recursively document members (enums nested in classes, etc.):undoc-members:include members without docstring:nodocstring:do not show the docstring:file-location:add a paragraph with the file location:exclude-members:exclude these members:private-members:show private membersManual documentation for Swift typesThe Swift Domain contains the following directives, if the directive declares what you
document you can skip the corresponding Swift keyword (Example:.. swift:class:: Classname).. swift:function::toplevel functions.. swift:class::class definitions.. swift:struct::struct definitions.. swift:enum::enum definitions.. swift:protocol::protocol definitions.. swift:extension::extensions and default implementations for protocols.. swift:method::func signatures.. swift:class_method::class functions.. swift:static_method::static methods in structs or protocols.. swift:init::initializers.. swift:enum_case::enum cases.. swift:let::let constants.. swift:var::variables.. swift:static_let::static let constants.. swift:static_var::static variablesall of those have a:noindex:parameter to keep it out of the index.anarchysphinxcommand line toolusage: anarchysphinx [-h] [--private] [--overwrite] [--undoc-members]
                     [--no-members] [--file-location] [--no-index]
                     [--no-index-members] [--exclude-list file]
                     [--use-autodocumenter]
                     source_path documentation_path

Bootstrap ReStructured Text documentation for Swift code.

positional arguments:
  source_path           Path to Swift files
  documentation_path    Path to generate the documentation in

optional arguments:
  -h, --help            show this help message and exit
  --private             Include private and internal members
  --overwrite           Overwrite existing documentation
  --undoc-members       Include members without documentation block
  --no-members          Do not include member documentation
  --file-location       Add a paragraph with file location where the member
                        was defined
  --no-index            Do not add anything to the index
  --no-index-members    Do not add members to the index, just the toplevel
                        items
  --exclude-list file   File with exclusion list for members
  --use-autodocumenter  Do not dump actual documentation but rely on the auto
                        documenter, may duplicate documentation in case you
                        have defined extensions in multiple filesGenerate Dash docsets with sphinxAdd the following to your sphinxMakefile. You will need the pip packagedoc2dashinstalled for this to work.On top in the variable declaration section:PROJECT_NAME=myprojectIn the helptext section:@echo "  dashdoc    to make Dash docset"Below thehtmltarget:.PHONY: dashdoc
dashdoc:
    $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) -D 'html_sidebars.**=""' $(BUILDDIR)/dashdoc
    doc2dash -v -n $(PROJECT_NAME) -d $(BUILDDIR)/ -f -I index.html -j $(BUILDDIR)/dashdoc
    @echo
    @echo "Build finished. The Docset is in $(BUILDDIR)/$(PROJECT_NAME).docset."and run the build withmake dashdoc