summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-03-13 23:08:23 +0100
committerCarlos Garnacho <carlosg@gnome.org>2022-04-03 18:47:17 +0000
commit0cc8ba55c167d0570360cf32eaf00e5510b0f188 (patch)
treec240063add12d9221135127305514e654e1f6c80 /docs
parentea852d502f0dbd57bd54780adb811ee5c64870df (diff)
downloadtracker-0cc8ba55c167d0570360cf32eaf00e5510b0f188.tar.gz
docs: Remove hack to embed files
This is something hotdoc can do for us, there is no need for an script here.
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/reference/libtracker-sparql/embed-files.py25
-rw-r--r--docs/reference/libtracker-sparql/examples.md (renamed from docs/reference/libtracker-sparql/examples.md.in)32
-rw-r--r--docs/reference/libtracker-sparql/meson.build20
3 files changed, 21 insertions, 56 deletions
diff --git a/docs/reference/libtracker-sparql/embed-files.py b/docs/reference/libtracker-sparql/embed-files.py
deleted file mode 100755
index df993b24f..000000000
--- a/docs/reference/libtracker-sparql/embed-files.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/python3
-
-import os, sys, re
-
-f = open(sys.argv[1])
-content = f.read()
-f.close()
-
-dirname = os.path.dirname(sys.argv[1])
-
-regex = re.compile('{{(.*)}}')
-matches = regex.findall(content)
-replacements = {}
-
-for m in matches:
- f = open(os.path.join(dirname, m))
- embedded = f.read()
- escaped = embedded.replace('\\', '\\\\')
- replace = re.compile('{{' + m + '}}')
- content = replace.sub(escaped, content)
- f.close()
-
-f = open(sys.argv[2], 'w')
-f.write(content)
-f.close()
diff --git a/docs/reference/libtracker-sparql/examples.md.in b/docs/reference/libtracker-sparql/examples.md
index 6a60320a7..bf60aaee9 100644
--- a/docs/reference/libtracker-sparql/examples.md.in
+++ b/docs/reference/libtracker-sparql/examples.md
@@ -34,9 +34,11 @@ main loop is not blocked while these operations are executed.
Once you end up with the query, remember to call [](tracker_sparql_cursor_close).
The same applies to [](tracker_sparql_connection_close) when no longer needed.
-```c
-{{examples/connection-example.c}}
-```
+<div class="gi-lang-c">
+
+{{ examples/connection-example.c }}
+
+</div>
## Creating a private database
@@ -58,9 +60,11 @@ main loop is not blocked while these operations are executed.
Once you no longer need the connection, remember to call
[](tracker_sparql_connection_close) on the [](TrackerSparqlConnection).
-```c
-{{examples/private-store-example.c}}
-```
+<div class="gi-lang-c">
+
+{{ examples/private-store-example.c }}
+
+</div>
## Creating a SPARQL endpoint
@@ -73,9 +77,11 @@ concretely the creation of a D-Bus endpoint, that other applications
may query e.g. through a connection created with
[](tracker_sparql_connection_bus_new).
-```c
-{{examples/endpoint-example.c}}
-```
+<div class="gi-lang-c">
+
+{{ examples/endpoint-example.c }}
+
+</div>
## Receiving notification on changes
@@ -88,6 +94,8 @@ on changes of certain RDF classes (Those with the
This example demonstrates the use of [](TrackerNotifier) to receive
notifications on database updates.
-```c
-{{examples/notifier-example.c}}
-```
+<div class="gi-lang-c">
+
+{{ examples/notifier-example.c }}
+
+</div>
diff --git a/docs/reference/libtracker-sparql/meson.build b/docs/reference/libtracker-sparql/meson.build
index 64254ddf3..edfa6e22b 100644
--- a/docs/reference/libtracker-sparql/meson.build
+++ b/docs/reference/libtracker-sparql/meson.build
@@ -9,25 +9,6 @@ endif
hotdoc = import('hotdoc')
-documents_with_examples = [
- [ 'examples.md.in', 'examples.md' ],
-]
-examples = []
-
-foreach doc : documents_with_examples
- examples += custom_target(
- 'examples-generate',
- input: doc[0],
- output: doc[1],
- command: [
- 'embed-files.py',
- '@INPUT@',
- '@OUTPUT@',
- ],
- depend_files: [ doc[0] ],
- build_by_default: true)
-endforeach
-
base_ontology_docs = custom_target('ontology-docgen',
output: ['dc-ontology.md'],
command: [tracker_docgen,
@@ -53,6 +34,7 @@ nepomuk_ontology_docs = custom_target('nepomuk-docgen',
content = [
'overview.md',
+ 'examples.md',
'ontologies.md',
'limits.md',
'performance.md',