aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-10-04 19:39:36 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-10-04 19:39:36 +0200
commitb672ebca886dd6dc9b0f775eb769764750fd302c (patch)
tree342bc608e79ed7a248ca849b77d52ff63dbdab8b
parent0b9c7b74bef2dd5913cc8d96de0fc016d682ead1 (diff)
downloadmeson-b672ebca886dd6dc9b0f775eb769764750fd302c.zip
meson-b672ebca886dd6dc9b0f775eb769764750fd302c.tar.gz
meson-b672ebca886dd6dc9b0f775eb769764750fd302c.tar.bz2
Minor fixups
-rw-r--r--docs/refman/generatormd.py4
-rw-r--r--docs/refman/templates/root.mustache13
-rw-r--r--docs/yaml/builtins/host_machine.yaml1
-rw-r--r--docs/yaml/builtins/target_machine.yaml1
-rw-r--r--docs/yaml/objects/build_tgt.yaml2
-rw-r--r--docs/yaml/objects/external_program.yaml39
6 files changed, 51 insertions, 9 deletions
diff --git a/docs/refman/generatormd.py b/docs/refman/generatormd.py
index 704ca3b..abf8a99 100644
--- a/docs/refman/generatormd.py
+++ b/docs/refman/generatormd.py
@@ -156,7 +156,9 @@ class GeneratorMD(GeneratorBase):
return ' | '.join([data_type_to_str(x) for x in typ.resolved])
def len_stripped(s: str) -> int:
- return len(re.sub(r'<[^>]+>', '', s))
+ s = s.replace(']]', '')
+ # I know, this regex is ugly but it works.
+ return len(re.sub(r'\[\[(#|@)*([^\[])', r'\2', s))
def render_signature() -> str:
# Skip a lot of computations if the function does not take any arguments
diff --git a/docs/refman/templates/root.mustache b/docs/refman/templates/root.mustache
index b62a6f6..cd846ac 100644
--- a/docs/refman/templates/root.mustache
+++ b/docs/refman/templates/root.mustache
@@ -11,7 +11,7 @@ and methods are documented in detail in the following subpages:
## Elementary types
{{#elementary}}
-{{>root_link}}
+{{indent}}- {{&link}}
{{/elementary}}
## Functions
@@ -21,7 +21,7 @@ to see the description and usage. The objects returned by them are
[listed here](#returned-objects).
{{#functions}}
-{{>root_link}}
+{{indent}}- {{&link}}
{{/functions}}
## Builtin objects
@@ -29,7 +29,7 @@ to see the description and usage. The objects returned by them are
These are built-in objects that are always available.
{{#builtins}}
-{{>root_link}}
+{{indent}}- {{&link}}
{{/builtins}}
## Returned objects
@@ -38,11 +38,14 @@ These are objects that can be returned by [functions](#functions)
or other methods.
{{#returned}}
-{{>root_link}}
+{{indent}}- {{&link}}
{{/returned}}
## Modules
{{#modules}}
-{{>root_link}}
+{{indent}}- {{&link}}
{{/modules}}
+
+
+<!-- The links used to be generated wit {>root_link}, but this is a bit hard to read -->
diff --git a/docs/yaml/builtins/host_machine.yaml b/docs/yaml/builtins/host_machine.yaml
index f130586..2c847b5 100644
--- a/docs/yaml/builtins/host_machine.yaml
+++ b/docs/yaml/builtins/host_machine.yaml
@@ -1,5 +1,6 @@
name: host_machine
long_name: Host machine information
+extends: build_machine
description: |
Provides information about the host machine -- the machine on which the
compiled binary will run. See
diff --git a/docs/yaml/builtins/target_machine.yaml b/docs/yaml/builtins/target_machine.yaml
index d5c4e4d..c17adc7 100644
--- a/docs/yaml/builtins/target_machine.yaml
+++ b/docs/yaml/builtins/target_machine.yaml
@@ -1,5 +1,6 @@
name: target_machine
long_name: Target machine information
+extends: build_machine
description: |
Provides information about the target machine -- the machine on which
the compiled binary's output will run. Hence, this object should only
diff --git a/docs/yaml/objects/build_tgt.yaml b/docs/yaml/objects/build_tgt.yaml
index e1c8a80..97c0c5d 100644
--- a/docs/yaml/objects/build_tgt.yaml
+++ b/docs/yaml/objects/build_tgt.yaml
@@ -5,8 +5,6 @@ description: |
A build target is either an executable, shared library, static library,
both shared and static library or shared module.
- TODO: Missing methods, links
-
methods:
- name: full_path
returns: str
diff --git a/docs/yaml/objects/external_program.yaml b/docs/yaml/objects/external_program.yaml
index d0e476f..02bf48f 100644
--- a/docs/yaml/objects/external_program.yaml
+++ b/docs/yaml/objects/external_program.yaml
@@ -1,3 +1,40 @@
name: external_program
long_name: External program
-description: TODO
+description: Opaque object representing an external program
+
+methods:
+- name: found
+ returns: bool
+ description: Returns whether the executable was found.
+
+- name: path
+ returns: str
+ deprecated: 0.55.0
+ description: |
+ *Deprecated:* Use [[external_program.full_path]] instead.
+
+ Returns a string pointing to the script or executable.
+
+ **NOTE:** You should not need to use this method. Passing the object itself
+ should work in all cases.
+
+ For example:
+
+ ```meson
+ run_command(find_program('foo'), 'arg1', 'arg2')
+ ```
+
+- name: full_path
+ returns: str
+ since: 0.55.0
+ description: |
+ Returns a string pointing to the script or executable.
+
+ **NOTE:** You should not need to use this method. Passing the object itself
+ should work in all cases.
+
+ For example:
+
+ ```meson
+ run_command(find_program('foo'), 'arg1', 'arg2')
+ ```