diff --git a/00-grc-docs.conf.in b/00-grc-docs.conf.in new file mode 100644 index 0000000..ff7a7c4 --- /dev/null +++ b/00-grc-docs.conf.in @@ -0,0 +1,4 @@ +# This should link to the wiki page-per-block documentation, when the block label (e.g., FFT) is appended to the end of the string + +[grc-docs] +wiki_block_docs_url_prefix = @GRC_DOCS_URL_PREFIX@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 0724c8d..67fe09a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,7 @@ GR_REGISTER_COMPONENT("gnuradio-companion" ENABLE_GRC if(ENABLE_GRC) ######################################################################## -# Create and install the grc conf file +# Create and install the grc and grc-docs conf file ######################################################################## file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${GRC_BLOCKS_DIR} blocksdir) if(CMAKE_INSTALL_PREFIX STREQUAL "/usr") @@ -132,6 +132,16 @@ install( DESTINATION ${GR_PREFSDIR} ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/00-grc-docs.conf.in + ${CMAKE_CURRENT_BINARY_DIR}/00-grc-docs.conf +@ONLY) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/00-grc-docs.conf + DESTINATION ${GR_PREFSDIR} +) + ######################################################################## # Install (+ compile) python sources and data files ######################################################################## diff --git a/gui/Config.py b/gui/Config.py index 28dd737..cd1062f 100644 --- a/gui/Config.py +++ b/gui/Config.py @@ -96,6 +96,10 @@ class Config(CoreConfig): def xterm_executable(self): return self._gr_prefs.get_string('grc', 'xterm_executable', 'xterm') + @property + def wiki_block_docs_url_prefix(self): + return self._gr_prefs.get_string('grc-docs', 'wiki_block_docs_url_prefix', '') + @property def default_canvas_size(self): try: # ugly, but matches current code style diff --git a/gui/PropsDialog.py b/gui/PropsDialog.py index 4dc98ff..1e23e04 100644 --- a/gui/PropsDialog.py +++ b/gui/PropsDialog.py @@ -57,6 +57,7 @@ class PropsDialog(Gtk.Dialog): self._block = block self._hash = 0 + self._config = parent.config vpaned = Gtk.VPaned() self.vbox.pack_start(vpaned, True, True, 0) @@ -211,6 +212,12 @@ class PropsDialog(Gtk.Dialog): buf.delete(buf.get_start_iter(), buf.get_end_iter()) pos = buf.get_end_iter() + # Add link to wiki page for this block, at the top + note = "Wiki Page for this Block: " + prefix = self._config.wiki_block_docs_url_prefix + suffix = self._block.label.replace(" ", "_") + buf.insert(pos, note + prefix + suffix + '\n\n') + docstrings = self._block.documentation.copy() if not docstrings: return