summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--grc/00-grc-docs.conf.in4
-rw-r--r--grc/CMakeLists.txt12
-rw-r--r--grc/gui/Config.py4
-rw-r--r--grc/gui/PropsDialog.py7
5 files changed, 29 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5af9afd5f6..21b9246203 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,6 +68,9 @@ set(MSVC_MIN_VERSION "1800")
# Enable generation of compile_commands.json for code completion engines
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+# Set wiki block docs url prefix used in grc-docs.conf (block name gets appended to end of this string)
+set(GRC_DOCS_URL_PREFIX "https://wiki.gnuradio.org/index.php/")
+
########################################################################
# Configure CMake policies
########################################################################
diff --git a/grc/00-grc-docs.conf.in b/grc/00-grc-docs.conf.in
new file mode 100644
index 0000000000..ff7a7c442d
--- /dev/null
+++ b/grc/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/grc/CMakeLists.txt b/grc/CMakeLists.txt
index 0724c8dc51..67fe09aedb 100644
--- a/grc/CMakeLists.txt
+++ b/grc/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/grc/gui/Config.py b/grc/gui/Config.py
index 28dd737984..cd1062ff87 100644
--- a/grc/gui/Config.py
+++ b/grc/gui/Config.py
@@ -97,6 +97,10 @@ class Config(CoreConfig):
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
raw = self._gr_prefs.get_string('grc', 'canvas_default_size', '1280, 1024')
diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py
index 4dc98ff1ab..1e23e04130 100644
--- a/grc/gui/PropsDialog.py
+++ b/grc/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