Skip to content
Snippets Groups Projects
Commit ac1a8018 authored by Remi Lazarini's avatar Remi Lazarini Committed by David Bühler
Browse files

[Ivette] corrections in markdown doc and tag

parent eda7473e
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,7 @@ export function LCD(props: LabelProps): JSX.Element {
// --- Led
// --------------------------------------------------------------------------
const LEDStatusList = [
export const LEDStatusList = [
'active', 'inactive', 'positive', 'negative', 'warning'
] as const;
......
......@@ -95,7 +95,7 @@ export function SVG(props: SVGprops): null | JSX.Element {
// --- Icon Component
// --------------------------------------------------------------------------
const iconKindList = [
export const iconKindList = [
'disabled', 'selected', 'positive', 'negative', 'warning', 'default'
] as const;
......
......@@ -26,11 +26,13 @@ import remarkCustomHeaderId from 'remark-custom-header-id';
import * as Themes from 'dome/themes';
import { classes } from 'dome/misc/utils';
import { Icon, jIconKind } from 'dome/controls/icons';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Icon, jIconKind, IconKind } from 'dome/controls/icons';
import {
CodeBlock, atomOneDark, atomOneLight
} from "react-code-blocks";
import { jLEDstatus, LED } from 'dome/controls/displays';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { jLEDstatus, LED, LEDstatus } from 'dome/controls/displays';
export interface Pattern {
pattern: RegExp,
......@@ -38,39 +40,37 @@ export interface Pattern {
}
/**
* iconTag allows you to replace the tag with an icon.
* iconTag allows you to replace the tag with an {@link Icon}.
*
* The associated regex is `/(\[ex:\])?(\[icon-([^-\]]+)(-([^\]]+))?\])/g`.
* `[icon-<id>(-<kind | color>)?]` :
*
* * first capture `[ex:]` (option): allows to write the second group without
* applying a replacement if exist
* * second capture : represents the icon with `ID` and `kind | color`
* * capture 3 : the icon Id
* * capture 4-5 (option): the kind or color of the icon
* * Id : case-insensitive, consult [Icon Gallery](../../doc/guides/icons.md)
* * kind : {@link IconKind}
* * color : Hexa or html
*
* Exemple :
* `[icon-TUNINGS-#FF0000]` this tag will be replaced by a red TUNINGS icon
* @example
* [icon-tunings-#FF0000] : this tag will be replaced by a red TUNINGS icon
*/
export const iconTag: Pattern = {
pattern: /(\[ex:\])?(\[icon-([^-\]]+)(-([^\]]+))?\])/g,
pattern: /(\[icon-([^-\]]+)(-([^\]]+))?\])/g,
replace: (key: number, match?: RegExpExecArray) => {
if(!match) return null;
const id = match[3];
const kind = jIconKind(match[5]);
const color = !kind ? match[5] : undefined;
if(match[1] === "[ex:]") {
return <span key={key}>{match[2]}</span>;
}
return <Icon key={key} id={id} kind={kind} fill={color}/>;
const kind = jIconKind(match[4]);
const color = !kind ? match[4] : undefined;
return <Icon key={key}
id={match[2].toUpperCase()}
kind={kind}
fill={color}
/>;
}
};
/**
* ledTag allows you to replace the tag with an LED.
* The associated regex is `/\[led-([^\]]+)\]/g`.
* ledTag allows you to replace the tag with an {@link LED}.
*
* The capture `([^\]]+)` represents the LEDStatus.
*/
* `[led-<status>]` : {@link LEDstatus}
* */
export const ledTag: Pattern = {
pattern: /\[led-([^\]]+)\]/g,
replace: (key: number, match?: RegExpExecArray) => {
......
......@@ -72,7 +72,9 @@
.dome-pages li
{
&:has(.code-inline) {
margin: 5px 0;
}
}
.dome-pages a
......
......@@ -23,10 +23,10 @@ This component is divided into 4 parts, the [titlebar](#plugins-callgraph-titleb
The titlebar contains the name of the module on the left and the following buttons on the right:
* [icon-TUNINGS] : Filter functions appearing in the graph. Ce filtre est synchronisé avec celui de la sidebar.
* [icon-TARGET] : Move the camera to show each node after each render.
* [icon-PIN] : Automatically select node of the function selected in AST.
* [icon-HELP] : show this help modal.
* [icon-tunings] : Filter functions appearing in the graph. Ce filtre est synchronisé avec celui de la sidebar.
* [icon-target] : Move the camera to show each node after each render.
* [icon-pin] : Automatically select node of the function selected in AST.
* [icon-help] : show this help modal.
##Toolbar {#plugins-callgraph-toolbar}
......@@ -42,7 +42,7 @@ On the left, there is a group of buttons for selecting the nodes that will appea
On the right:
* Horizontal and vertical distance management between graph nodes.
* [icon-SIDEBAR] : Opens or closes the side panel.
* [icon-sidebar] : Opens or closes the side panel.
## Panel {#callgraph-panel}
......@@ -57,7 +57,7 @@ The graph is in 3D but is displayed as a tree. This type of display prevents cyc
If a cycle is detected :
* In the case of a recursive function: The link is deleted and the [icon-REDO-orange] icon is added to the node.
* In the case of a recursive function: The link is deleted and the [icon-redo-orange] icon is added to the node.
* In the case of a cycle on several functions: The cycles will be pre-selected and will appear in the selection button.
### Nodes
......@@ -66,8 +66,8 @@ The nodes display the name of the function and the following elements:
* [led-warning] : The function contains unproven properties, a tooltip gives the quantity.
* [led-negative] : The function contains false properties, a tooltip gives the quantity.
* [icon-REDO-orange] : The function is recursive.
* [icon-DROP.FILLED-#882288][icon-DROP.FILLED-#73BBBB]: The function contains tainted properties.
* [icon-redo-orange] : The function is recursive.
* [icon-drop.filled-#882288][icon-drop.filled-#73BBBB]: The function contains tainted properties.
### Edges
......
......@@ -100,9 +100,9 @@ You can used patterns to replace parts of the text by JSX Element.
There is one basic pattern to replace tags by an `Icon`, it name `iconTag` in markdown component .
* [icon-TUNINGS] : [ex:][icon-TUNINGS]
* [icon-TUNINGS-#ff0000] : [ex:][icon-TUNINGS-#ff0000]
* [icon-TARGET] : [ex:][icon-TARGET]
* [icon-PIN] : [ex:][icon-PIN]
* [icon-tunings] : `[icon-tunings]`
* [icon-tunings-#ff0000] : `[icon-tunings-#ff0000]`
* [icon-target] : `[icon-target]`
* [icon-pin] : `[icon-pin]`
or inline [icon-TUNINGS], [icon-TARGET], [icon-PIN]
or inline [icon-tunings], [icon-target], [icon-pin]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment