DocInventories.Inventory
— TypeAn inventory link targets in a project documentation.
inventory = Inventory(
+)
diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json
index 78f01cf..be29ea4 100644
--- a/dev/.documenter-siteinfo.json
+++ b/dev/.documenter-siteinfo.json
@@ -1 +1 @@
-{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-02-23T18:09:57","documenter_version":"1.2.1"}}
\ No newline at end of file
+{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-02-23T20:10:29","documenter_version":"1.2.1"}}
\ No newline at end of file
diff --git a/dev/api/index.html b/dev/api/index.html
index 00ab541..3ab6908 100644
--- a/dev/api/index.html
+++ b/dev/api/index.html
@@ -5,11 +5,11 @@
".toml" => MIME("application/toml"),
".txt.gz" => MIME("text/x-intersphinx+gzip"),
".toml.gz" => MIME("application/toml+gzip"),
-)source An inventory link targets in a project documentation. An inventory link targets in a project documentation. loads an inventory file from the given The Alternatively, with a mandatory Attributes Item access Items can be accessed via iteration ( Search The inventory can be searched by calling The search results are sorted by Methods An error indicating an issue with an inventory file. An item inside an represents a linkable item inside a project documentation, referenced by For convenience, an loads an inventory file from the given The Alternatively, with a mandatory Attributes Note that Item access Items can be accessed via iteration ( Search The inventory can be searched by calling The search results are sorted by Methods An error indicating an issue with an inventory file. An item inside an represents a linkable item inside a project documentation, referenced by For convenience, an indicates a link to a section header in the documentation of a project. The Attributes See Methods Determine the MIME type of the given file path or URL from the file extension. returns a Unknown or unsupported extensions throw an Convert an inventory file. converts the input file This is a convenience function to simply load an Obtain the full display name for an returns Find an item in the inventory. indicates a link to a section header in the documentation of a project. The Attributes See Methods Determine the MIME type of the given file path or URL from the file extension. returns a Unknown or unsupported extensions throw an Convert an inventory file. converts the input file This is a convenience function to simply load an Obtain the full display name for an returns Find an item in the inventory. returns the top priority Arguments Note that direct item lookup as Obtain the root url from an inventory source. returns the root url as determined by Write the writes Modify the returns the top priority Arguments Note that direct item lookup as Obtain the root url from an inventory source. returns the root url as determined by Write the writes Modify the modifies the is equivalent to and shows the is equivalent to and shows the entire Return the specification string of an returns a string of the form Split a URL into a root URL and a filename. splits is equivalent to fully expands DocInventories.Inventory
— Typeinventory = Inventory(
+)
DocInventories.Inventory
— Typeinventory = Inventory(
source;
mime=auto_mime(source),
root_url=root_url(source)
-)
source
, which can be a URL or the path to a local file. If it is a URL, the options timeout
(seconds to wait for network connections), retries
(number of times to retry) and wait_time
(seconds longer to wait between each retry) may be given. The source
must contain data in the given mime type. By default, the mime type is derived from the file extension, via auto_mime
.Inventory
acts as a collection of InventoryItems
, representing all the objects, sections, or other linkable items in the online documentation of a project.inventory = Inventory(; project, version="", root_url="", items=[])
project
argument instantiates an inventory
with the IventoryItems
in items
. If items
is not given, the resulting empty inventory
can have InventoryItems
added afterwards via push!
.project
: The name of the projectversion
: The version of the project (e.g., "1.0.0"
)root_url
: The root URL to which the item.uri
of any InventoryItem
is relative. If not empty, should start with "https://"
and end with a slash.source
: The URL or filename from which the inventory was loaded, or a comment if the inventory was constructed otherwise.sorted
: A boolean to indicate whether the items are sorted by their name
attribute, allowing for efficient lookup. This is true
for all inventories loaded from a URL or file and false
for manually instantiated inventories.for item in inventory
), by numeric index (inventory[1]
, inventory[2]
, … inventory[end]
), or by lookup: inventory[name]
or inventory[spec]
, where spec
is a string of the form ":[domain:]role:`name`"
, see the discussion of spec
in InventoryItem
. The lookup delegates to find_in_inventory
with quiet=true
and takes into account item.priority
.inventory(search; include_hidden_priority=true)
. This returns a list of all items that contain search
in spec(item)
or repr(item; context=(:full => true))
. Typically, search
would be a string or a Regex
. Some examples for common searches:spec
of the form ":domain:role:`name`"
, in full, partially, or as a regex.abs(item.priority)
. If include_hidden_priority=false
, negative item.priority
values are omitted.find_in_inventory(inventory, name)
– find a single item in the inventory
save(filename, inventory; mime=auto_mime(filename))
– write the inventory
to a file in any supported output format.show_full(inventory)
– show the unabbreviated inventory in the REPL (ideally via TerminalPager
)uri(inventory, key)
– obtain the full URI for an item from the inventory
.push!(inventory, items...)
– add InventoryItems
to an existing inventory
.append!(inventory, collections...)
– add collections of InventoryItems
to an existing inventory
.collect(inventory)
– convert the inventory to a standard Vector
of InventoryItems
.set_metadata(inventory)
– Modify the project
and version
metadata.sort(inventory)
– convert an unsorted inventory into a sorted one.DocInventories.InventoryFormatError
— Typethrow(InventoryFormatError(msg))
DocInventories.InventoryItem
— TypeInventory
.item = InventoryItem(; name, role, uri, priority=1, domain="jl", dispname="-")
name
. The domain
and role
take their semantics from the Sphinx project, see Attributes for details on these parameters, as well as priority
and dispname
. The uri
is relative to a project root, which should be the Inventory.root_url
of the inventory
containing the InventoryItem
.InventoryItem
can also be instantiated from a mapping spec => uri
, where spec=":domain:role:`name`"
borrows from Sphinx' cross-referencing syntax:item = IventoryItem(
+)
source
, which can be a URL or the path to a local file. If it is a URL, the options timeout
(seconds to wait for network connections), retries
(number of times to retry) and wait_time
(seconds longer to wait between each retry) may be given. The source
must contain data in the given mime type. By default, the mime type is derived from the file extension, via auto_mime
.Inventory
acts as a collection of InventoryItems
, representing all the objects, sections, or other linkable items in the online documentation of a project.inventory = Inventory(; project, version="", root_url="", items=[])
project
argument instantiates an inventory
with the IventoryItems
in items
. If items
is not given, the resulting empty inventory
can have InventoryItems
added afterwards via push!
.project
: The name of the projectversion
: The version of the project (e.g., "1.0.0"
)root_url
: The root URL to which the item.uri
of any InventoryItem
is relative. If not empty, should start with "https://"
and end with a slash.source
: The URL or filename from which the inventory was loaded.sorted
: A boolean to indicate whether the items are sorted by their name
attribute, allowing for efficient lookup. This is true
for all inventories loaded from a URL or file and false
for manually instantiated inventories.source
and sorted
are informational attributes only and are ignored when comparing two Inventory
objects.for item in inventory
), by numeric index (inventory[1]
, inventory[2]
, … inventory[end]
), or by lookup: inventory[name]
or inventory[spec]
, where spec
is a string of the form ":[domain:]role:`name`"
, see the discussion of spec
in InventoryItem
. The lookup delegates to find_in_inventory
with quiet=true
and takes into account item.priority
.inventory(search; include_hidden_priority=true)
. This returns a list of all items that contain search
in spec(item)
or repr(item; context=(:full => true))
. Typically, search
would be a string or a Regex
. Some examples for common searches:spec
of the form ":domain:role:`name`"
, in full, partially, or as a regex.abs(item.priority)
. If include_hidden_priority=false
, negative item.priority
values are omitted.find_in_inventory(inventory, name)
– find a single item in the inventory
save(filename, inventory; mime=auto_mime(filename))
– write the inventory
to a file in any supported output format.show_full(inventory)
– show the unabbreviated inventory in the REPL (ideally via TerminalPager
)uri(inventory, key)
– obtain the full URI for an item from the inventory
.push!(inventory, items...)
– add InventoryItems
to an existing inventory
.append!(inventory, collections...)
– add collections of InventoryItems
to an existing inventory
.collect(inventory)
– convert the inventory to a standard Vector
of InventoryItems
.set_metadata(inventory)
– Modify the project
and version
metadata.sort(inventory)
– convert an unsorted inventory into a sorted one.DocInventories.InventoryFormatError
— Typethrow(InventoryFormatError(msg))
DocInventories.InventoryItem
— TypeInventory
.item = InventoryItem(; name, role, uri, priority=1, domain="jl", dispname="-")
name
. The domain
and role
take their semantics from the Sphinx project, see Attributes for details on these parameters, as well as priority
and dispname
. The uri
is relative to a project root, which should be the Inventory.root_url
of the inventory
containing the InventoryItem
.InventoryItem
can also be instantiated from a mapping spec => uri
, where spec=":domain:role:`name`"
borrows from Sphinx' cross-referencing syntax:item = IventoryItem(
":domain:role:`name`" => uri;
dispname=<name>,
priority=(<domain == "std" ? -1 : 1>)
@@ -17,14 +17,14 @@
"title" => uri;
dispname=<title>,
priority=-1
-)
name
will be a sluggified version of the title, making the item
equivalent to item = IventoryItem(":std:label:`name`" => uri; dispname=title, priority=-1)
.name
: The object name for referencing. For code objects, this should be the fully qualified name. For section names, it may be a slugified version of the section title. It must have non-zero length.domain
: The name of a Sphinx domain. Should be "jl"
for Julia code objects (default), "py"
for Python code objects, and "std"
for text objects such as section names. Must have non-zero length, and must not contain whitespace or a colon.role
: A domain-specific role (type). Must have nonzero length and not contain whitespace.priority
: An integer flag for placement in search results. Used when searching in an Inventory
, for item access in an Inventory
, and with find_in_inventory
. The following flag values are supported:1
: the "default" priority. Used by default for all objects not in the "std"
domain (that is, all "code" objects such as those in the "jl"
domain).0
: object is important2
(or higher): object is unimportant-1
(or lower): object is "hidden" (may be omitted from search). Used by default for all objects in the std
domain (section titles)find_in_inventory
for details. The above semantics match those used by Sphinx.uri
: A URI for the location of the object's documentation, relative to the location of the inventory file containing the item
. Must not contain whitespace. May end with "$"
to indicate a placeholder for name
(usually as "#$"
, for an HTML anchor matching name
).dispname
: A full plain text representation of the object. May be "-"
if the display name is identical to name
(which it should be for code objects). For section titles, this should be the plain text of the title, without formatting, but not slugified.DocInventories.auto_mime
— Methodmime = auto_mime(source)
MIME
type from the extension of source
. The default mapping is in MIME_TYPES
.ArgumentError
.DocInventories.convert
— MethodDocInventories.convert("objects.inv", "inventory.toml")
"objects.inv"
in the Sphinx Inventory Format to the TOML Format "inventory.toml"
.Inventory
from the input file and write it to the output file. Both the input and output file must have known file extensions. The project
and version
metadata may be given as additional keyword arguments to be written to the output file, see set_metadata
.DocInventories.dispname
— MethodInventoryItem
.display_name = dispname(item)
item.dispname
with "-"
expanded to item.name
.DocInventories.find_in_inventory
— Methoditem = find_in_inventory(
+)
name
will be a sluggified version of the title, making the item
equivalent to item = IventoryItem(":std:label:`name`" => uri; dispname=title, priority=-1)
.name
: The object name for referencing. For code objects, this should be the fully qualified name. For section names, it may be a slugified version of the section title. It must have non-zero length.domain
: The name of a Sphinx domain. Should be "jl"
for Julia code objects (default), "py"
for Python code objects, and "std"
for text objects such as section names. Must have non-zero length, and must not contain whitespace or a colon.role
: A domain-specific role (type). Must have nonzero length and not contain whitespace.priority
: An integer flag for placement in search results. Used when searching in an Inventory
, for item access in an Inventory
, and with find_in_inventory
. The following flag values are supported:1
: the "default" priority. Used by default for all objects not in the "std"
domain (that is, all "code" objects such as those in the "jl"
domain).0
: object is important2
(or higher): object is unimportant-1
(or lower): object is "hidden" (may be omitted from search). Used by default for all objects in the std
domain (section titles)find_in_inventory
for details. The above semantics match those used by Sphinx.uri
: A URI for the location of the object's documentation, relative to the location of the inventory file containing the item
. Must not contain whitespace. May end with "$"
to indicate a placeholder for name
(usually as "#$"
, for an HTML anchor matching name
).dispname
: A full plain text representation of the object. May be "-"
if the display name is identical to name
(which it should be for code objects). For section titles, this should be the plain text of the title, without formatting, but not slugified.DocInventories.auto_mime
— Methodmime = auto_mime(source)
MIME
type from the extension of source
. The default mapping is in MIME_TYPES
.ArgumentError
.DocInventories.convert
— MethodDocInventories.convert("objects.inv", "inventory.toml")
"objects.inv"
in the Sphinx Inventory Format to the TOML Format "inventory.toml"
.Inventory
from the input file and write it to the output file. Both the input and output file must have known file extensions. The project
and version
metadata may be given as additional keyword arguments to be written to the output file, see set_metadata
.DocInventories.dispname
— MethodInventoryItem
.display_name = dispname(item)
item.dispname
with "-"
expanded to item.name
.DocInventories.find_in_inventory
— Methoditem = find_in_inventory(
inventory,
name;
domain="",
role="",
quiet=false,
include_hidden_priority=true
-)
InventoryItem
matching the given name
. If the inventory
contains no matching item, returns nothing
.inventory
: The Inventory
to search.name
: The value of the name
attribute of the InventoryItem
to find. Must match exactly.domain
: If not empty, restrict search to items with a matching domain
attribute.role
: If not empty, restrict search to items with a matching role
attribute.quiet
: If false
(default), log a warning if the item specification is ambiguous (the top priority item of multiple candidates is returned). If no matching item can be found, an error will be logged in addition to returning nothing
.include_hidden_priority
: Whether or not to consider items with a negative priority
attribute. If "hidden" items are included (default), they are sorted by the absolute value of the priority
. That is, items with priority=-1
and priority=1
are considered to be equivalent.inventory[spec]
where spec
is a string of the form "[:[domain:]role:]`name`"
is available as a simplified way to call find_in_inventory
with quiet=true
.DocInventories.root_url
— Methodurl = root_url(source; warn=true)
split_url
if source
starts with "https://"
or "http://"
, or an empty string otherwise (if source
is a local file path). An empty root url will emit a warning unless warn=false
.DocInventories.save
— MethodInventory
to file in the specified format.DocInventories.save(filename, inventory; mime=auto_mime(filename))
inventory
to filename
in the specified MIME type. By default, the MIME type is derived from the file extension of filename
via auto_mime
.DocInventories.set_metadata
— Methodproject
and version
metadata of an inventory or inventory file.new_inventory = set_metadata(
+)
InventoryItem
matching the given name
. If the inventory
contains no matching item, returns nothing
.inventory
: The Inventory
to search.name
: The value of the name
attribute of the InventoryItem
to find. Must match exactly.domain
: If not empty, restrict search to items with a matching domain
attribute.role
: If not empty, restrict search to items with a matching role
attribute.quiet
: If false
(default), log a warning if the item specification is ambiguous (the top priority item of multiple candidates is returned). If no matching item can be found, an error will be logged in addition to returning nothing
.include_hidden_priority
: Whether or not to consider items with a negative priority
attribute. If "hidden" items are included (default), they are sorted by the absolute value of the priority
. That is, items with priority=-1
and priority=1
are considered to be equivalent.inventory[spec]
where spec
is a string of the form "[:[domain:]role:]`name`"
is available as a simplified way to call find_in_inventory
with quiet=true
.DocInventories.root_url
— Methodurl = root_url(source; warn=true)
split_url
if source
starts with "https://"
or "http://"
, or an empty string otherwise (if source
is a local file path). An empty root url will emit a warning unless warn=false
.DocInventories.save
— MethodInventory
to file in the specified format.DocInventories.save(filename, inventory; mime=auto_mime(filename))
inventory
to filename
in the specified MIME type. By default, the MIME type is derived from the file extension of filename
via auto_mime
.DocInventories.set_metadata
— Methodproject
and version
metadata of an inventory or inventory file.new_inventory = set_metadata(
inventory;
version=inventory.version,
project=inventory.project
@@ -33,6 +33,6 @@
mime=auto_mime(filename),
project=Inventory(filename).project,
version=Inventory(filename).version,
-)
project
and/or version
in the given inventory file (objects.inv
, inventory.toml
, etc.)DocInventories.show_full
— Methodshow_full(item) # io=stdout
-show_full(io, item)
show(IOContext(io, :full => true), "text/plain", item)
InventoryItem
with all attributes.DocInventories.show_full
— Methodshow_full(inventory) # io=stdout
-show_full(io, inventory)
show(IOContext(io, :limit => false), "text/plain", inventory)
inventory
without truncating the list of items. This may produce large output, so you may want to make use of the TerminalPager
package.DocInventories.spec
— MethodInventoryItem
.item_spec = spec(item)
":domain:role:`name`"
using the attributes of the given item
.DocInventories.split_url
— Methodroot_url, filename = split_url(url)
url
at the last slash. This behaves like splitdir
, but operates on URLs instead of file paths. The URL must start with "https://"
or "http://"
.DocInventories.uri
— Methoduri_str = uri(inventory, key)
uri(inventory[key]; root_url=inventory.root_url)
.DocInventories.uri
— Methoduri_str = uri(item; root_url="")
item.uri
and prepends root_url
.
Settings
This document was generated with Documenter.jl version 1.2.1 on Friday 23 February 2024. Using Julia version 1.10.1.