ipypublish.filters.filters module¶
-
ipypublish.filters.filters.
create_key
(input, **kwargs)[source]¶ create sanitized key string which only contains lowercase letters, (semi)colons as c, underscores as u and numbers as roman numerals in this way the keys with different input should mainly be unique
>>> create_key('fig:A_10name56') 'figcauxnamelvi'
-
ipypublish.filters.filters.
dict_to_kwds
(inobject, kwdstr='', overwrite=True)[source]¶ convert a dictionary to a string of keywords, or, if a list, a string of options
append to an existing options string (without duplication)
- Parameters
Examples
>>> dict_to_kwds({"a":1,"c":3},'a=1,b=2') 'a=1,b=2,c=3' >>> dict_to_kwds(['a', 'c'],'a,b') 'a,b,c'
-
ipypublish.filters.filters.
first_para
(input, **kwargs)[source]¶ get only ttext before a n (i.e. the fist paragraph)
return an ipypublish caption or False
captions can either be located at cell_meta.ipub.<type>.caption, or at resources.caption[cell_meta.ipub.<type>.label]
the resources version is proritised
-
ipypublish.filters.filters.
get_empty_lines
(text)[source]¶ Get number of empty lines before and after text.
-
ipypublish.filters.filters.
is_equation
(text)[source]¶ test if a piece of text is a latex equation, by how it is wrapped
-
ipypublish.filters.filters.
wrap_eqn
(text, cell_meta, nb_meta, out='latex')[source]¶ wrap an equation in a latex equation environment
environment obtained (if present) from cell_meta.ipub.equation.environment) label obtained (if present) from cell_meta.ipub.equation.label) also, nb_meta.ipub.enable_breqn used