Public Access
build HTML docs at package build time and open them from the Help menu
- debian/rules: build sphinx HTML into build/html
- debian/install: install it as usr/share/doc/python3-damaris/html/
instead of shipping the raw doc/ source tree (whose gitignored
doc/_build never existed on CI checkouts)
- debian/control: declare ${sphinxdoc:Depends} and python3-sphinx
(provides sphinx-build) explicitly
- requirements.debian: install python3-sphinx explicitly
- DamarisGUI: point the manual at the packaged HTML path with a
source-tree fallback, populate the Help dropdown menu, and open
the DAMARIS manual on a plain toolbar click
- doc/manual.rst: document the Help menu
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
1 parent
ab943c30ae
commit
9cc449d6e1
6 files changed
+32
-10
No files matched your search
@@ -1276,15 +1276,31 @@ class DamarisGUI:
|
||||
|
||||
def documentation_init( self ):
|
||||
|
||||
self.doc_urls = {
|
||||
"DAMARIS Manual": "file:///usr/share/doc/python3-damaris/doc/_build/html/index.html",
|
||||
}
|
||||
doc_index_candidates = (
|
||||
"/usr/share/doc/python3-damaris/html/index.html",
|
||||
os.path.join( os.path.dirname( os.path.dirname( os.path.dirname(
|
||||
os.path.dirname( os.path.abspath( __file__ ) ) ) ) ),
|
||||
"doc", "_build", "html", "index.html" ),
|
||||
)
|
||||
|
||||
self.doc_urls = { }
|
||||
for doc_index in doc_index_candidates:
|
||||
if os.path.isfile( doc_index ):
|
||||
self.doc_urls[ "DAMARIS Manual" ] = "file://" + doc_index
|
||||
break
|
||||
|
||||
if os.path.isdir( "/usr/share/doc/python%d.%d-doc/html" % (sys.version_info[ :2 ]) ):
|
||||
self.doc_urls[ "Python Docs" ] = "file:///usr/share/doc/python%d.%d-doc/html/index.html" % (
|
||||
sys.version_info[ :2 ])
|
||||
|
||||
doc_index_url = None
|
||||
doc_menu = self.xml_gui.get_object( "documentation_menu" )
|
||||
for doc_title in self.doc_urls:
|
||||
doc_menu_item = gtk.MenuItem( label=doc_title )
|
||||
doc_menu_item.connect( "activate", self.show_doc_menu )
|
||||
doc_menu.append( doc_menu_item )
|
||||
doc_menu_item.show( )
|
||||
self.xml_gui.get_object( "documentation" ).set_menu( doc_menu )
|
||||
|
||||
self.doc_browser = None
|
||||
|
||||
def show_doc_menu( self, widget, data=None ):
|
||||
@@ -1294,7 +1310,7 @@ class DamarisGUI:
|
||||
if type( widget ) is gtk.MenuItem:
|
||||
requested_doc = widget.get_child( ).get_text( )
|
||||
else:
|
||||
requested_doc = "Python DAMARIS"
|
||||
requested_doc = "DAMARIS Manual"
|
||||
|
||||
if requested_doc in self.doc_urls and self.doc_urls[ requested_doc ] is not None:
|
||||
if self.doc_browser is not None:
|
||||
|
||||
Reference in new issue
Block a user