API∞
The API provides simple functions for embeddings in markdown documents.
Currently, there are three distinct kinds of embeddings: Section/subsection partial document embeddings, sequence like embeddings, and single item embeddings.
Document Part Functions∞
The following function produces markdown constructs that map parent issues with children issues onto subsections and subsubsections:
test_plans(parents_query_text, children_query_text)
- parent issues become subsections and children issues (including their description as content) become subsubsections
Sequence Functions∞
The following functions produce markdown constructs that receive sequences:
mbom_table(filename)
- a markdown GFM table from an excel workbookfilename
metrics_table(configuration)
- a markdown GFM table from a REST interface defined per configurationtable(query_text, show_summary=False, column_fields=None)
- a markdown GFM tabledl(query_text)
- a definition (description) listol(query_text)
- an ordered listul(query_text)
- an unordered list
Note: the table function allows to change the column labels by adding entries that are tuples or lists with two ordered members: key
and label
.
The following example will change the displayed column label for column Summary
to only show S
:
table('project = FOO AND labels = BAR', column_fields=('Key', ('Summary', 'S'), 'Baz', 'Quux'))
The following function produces separated values lists from JQL queries:
svl(query_text, key_magic=False, field_sep='|')
- a separated values list from a REST interface defined per configuration
Single Item Returning Functions∞
h1(query_text)
- a level 1 headingh2(query_text)
- a level 2 headingh3(query_text)
- a level 3 headingh4(query_text)
- a level 4 headingh5(query_text)
- a level 5 headingh6(query_text)
- a level 6 heading
Additional Parameters∞
All functions accept an optional keyword parameter data
that when given will render that data instead of querying a server.
This can be helpful to test the format without always querying the server.
For this data inject to work, the following characteristic must be present in the data:
data
value is a dict- with at least one
rows
key with a list as value.- that list contains one or more dicts with
- the expected keys (from the column spec) and
- the values that should be injected.
- that list contains one or more dicts with
- with at least one
from laskea import *
ul('', data={'rows': [{'key': 'A', 'summary': 'B'}, {'key': 'C', 'summary': 'D'}]})
This should yield the following output:
- [A](https://remote-jira-instance.example.com/browse/A) - B
- [C](https://remote-jira-instance.example.com/browse/C) - D
Using the svl function (that implements the csv command of the app:
from laskea import *
data = {'rows': [{'key': 'A', 'summary': 'B'}, {'key': 'C', 'summary': 'D'}]}
svl('', field_sep='x', data=data)
This should yield the following output:
keyxsummary
AxB
CxD
Using a field separator / delimiter that is contained within one of more values
like e.g. here the letter u
and a replacement text xoxo
:
from laskea import *
data = {'rows': [{'key': 'A', 'summary': 'B'}, {'key': 'C', 'summary': 'D'}]}
svl('', field_sep='u', replacement='xoxo', data=data)
Yields:
keyusxoxommary
AuB
CuD