Commit a580ed79 authored by Sanjay Yadav's avatar Sanjay Yadav

DOC: Updated documentation.

parent f0cbd4db
Pipeline #32702 failed with stage
in 50 seconds
......@@ -83,6 +83,7 @@ The configuration accepts the following top-level keys:
- `target`: required for the command line, and is where the output PPTX is saved.
It is optional for the API. If None, `pptgen` returns the Presentation object.
- `data`: optional dataset or a dictionary. This is described below.
- `register`: Optional to register any new custom commands to pptgen. It accepts a function which accepts three parameter `shape`, `spec`, and `data`. Available `immutable` commands in pptgen are `css`, `text`, `image`, `chart`, `table`, `sankey`, `bullet`, `replace`, `treemap`, `heatgrid` and `calendarmap`.
- All other keys are treated as rules that are described below.
## Data
......@@ -222,19 +223,21 @@ change-image:
### Register: Register a new command to PPTGen
Register let you create a custom command. It accepts a function which will accepts three parameters, `shape`, `spec`, `data` in same order. It will not accept any other parameter except these 3. Any existing command can not be overwrite. Return an immutable command list.
Register let you create a custom command. It accepts a function which will accepts three parameters, `shape`, `spec`(configuration for a shape, config under the shape name), `data` in same order. It will not accept any other parameter except these 3. Any existing command can not be overwrite. Return an immutable command list.
```yaml
source: input.pptx
target: output.pptx
custom-config:
register:
custom_command: view.custom_command # Registering a new command as `custom_command.`
custom_command2: view.custom_command2 # Registering a new command as `custom_command2.`
custom_command3:
function: view.custom_command2 # Registering a new command as `custom_command3.`
Shape Name 1:
data:
load_data: {url: data.csv}
register:
custom_command1: view.custom_command1 # Registering a new command as `custom_command1.`
custom_command2: view.custom_command2 # Registering a new command as `custom_command2.`
custom_command3:
function: view.custom_command3 # Registering a new command as `custom_command3.`
custom-config: # Rule
Shape Name 1: # Shape Name
custom_command:
.... Configuration
Shape Name 2:
......@@ -608,7 +611,7 @@ the chart.
- `good`: Good value.
- `target`: Target value.
- `gradient`: Optional. Default `RdYlGn`.
- `text`: Optional, if present text will be shown as per format.
- `text`: Default `True`. Optional, if present text will be shown as per format. Text can be overwrite inside `style.data.text` or `style.target.text` section if defined there.
- `style`: Optional `dict`, accepts css properties `e.g:- font-color, fill, opacity etc.`
Example:
......@@ -633,6 +636,7 @@ draw-bullet:
font-size: 12
fill: #ff00ff
target: # Overwriting CSS for target
text: False # Overwriting text for text. Text will not be shown
font-size: 12
color: '#cccccc'
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment