Skip to content

Commit

Permalink
- 3.0
Browse files Browse the repository at this point in the history
- Updated docs
  • Loading branch information
Machy8 committed Aug 20, 2017
1 parent 84e5cbb commit 0f93cc6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
6 changes: 4 additions & 2 deletions docs/Attributes and selectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ div class=myClass .myClass2 => <div class="myClass myClass2"></div>
````

## Boolean attributes
You can add another boolean attributes via `$macdom->addBooleanAttribute('attribute1 attribute2)`.
- Adding - `$macdom->addBooleanAttribute('attribute1 attribute2', Engine::CONTENT_HTML)`
- Removing - `$macdom->removeBooleanAttribute('attribute1 attribute2', Engine::CONTENT_HTML)`

```` Slim
input $text disabled readonly => <input type="text" disabled readonly>
Expand All @@ -55,7 +56,8 @@ Two options
* For short values or values without spaces use *$attributeValue*.
* For long values like text in a placeholder use *$attribute value;* (closed by a semicolon).

You can change element quick attributes by calling `$macdom->changeElementQuickAttributes('element', 'attributeA attributeB')`.
You can change element quick attributes by calling
`$macdom->changeElementQuickAttributes('element', 'attributeA attributeB', Engine::CONTENT_HTML)`.

### Default settings for each element

Expand Down
14 changes: 11 additions & 3 deletions docs/Compilation and formatting options.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Compilation and formatting options

## Setting content type
- Setting content type - `$macdom->setContentType(Engine::CONTENT_XHTML)` with one of the following options.
Content type options
- Engine::CONTENT_HTML => html elements
- Engine::CONTENT_XHTML => xhtml elements, xml syntax
- Engine::CONTENT_XML => xml elements, xml syntax

## Skipped areas
If you want to switch off macdom compilation simply nest the code into `macdom-off` tag.
If you want to switch off Macdom compilation simply nest the code into `macdom-off` tag.
Default ignored areas are *style, script, textarea, code, php*.

````
Expand All @@ -23,8 +30,9 @@ div

## Output formatter
Macdom is using [Xhtml formatter](https://github.com/Machy8/xhtml-formatter).
If you don't want to format the output code, you can switch off the formatter by wrapping your by `<formatter-off></formatter-off>` tag
or by calling the method `$macdom->disableOutputFormatter()` to disable the output formatter entirely.
If you don't want to format the output code, you can switch off the formatter
by wrapping your by `<formatter-off></formatter-off>` tag or by calling the method
`$macdom->disableOutputFormatter()` to disable the output formatter entirely.

````
<div>
Expand Down
2 changes: 1 addition & 1 deletion docs/Indentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ div (0 tabulators)
````

### Spaces
If you want to to use spaces indentation use `$macdom->setSpacesIndentation(length)`.
If you want to to use spaces indentation use `$macdom->setSpacesIndentation(4)`.

*Example:*
```` Slim
Expand Down
6 changes: 3 additions & 3 deletions docs/Macros.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Macros

Macros in Macdom are "prearranged code".

## Default macros
Expand Down Expand Up @@ -29,8 +28,9 @@ Macros in Macdom are "prearranged code".
| \.js$ | script $' . $keyword . ' $text/javascript ' . $line |
| \.css$ | link $' . $keyword . ' $stylesheet $text/css ' . $line |

## Macros addition
Is possible to add new macro by calling `$macdom->addMacro()`.
## Managing macros
- Adding `$macdom->addMacro()`
- Removing `$macdom->removeMacro('macroname', Engine::CONTENT_HTML)`

````
$quickList = function ($content) {
Expand Down
12 changes: 7 additions & 5 deletions docs/Replicator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Replicator

Replicator replicates lines content according to levels.
Lines are replicated only, if the actual compiled line is not within non-compile area and an html element wasn't detected.
Replicator replicates lines content according to levels. Lines are replicated only, if the actual compiled line
is not within non-compile area and an html element wasn't detected.

## How to use replicator
* Constructor
Expand All @@ -11,7 +10,6 @@ Lines are replicated only, if the actual compiled line is not within non-compile
1. /@
2. /@selector


### @
If there is only *@* at the beginning of the actual compiled line then its content will be used on each following line
that is on the same level, is not empty and is without the registered line selector.
Expand Down Expand Up @@ -97,7 +95,8 @@ Second
````

### Destructor
Destructor is used when we want to deregister line content and it must be on the same level on which the line content was registered.
Destructor is used when we want to deregister line content
and it must be on the same level on which the line content was registered.

*Example:*
````
Expand Down Expand Up @@ -126,13 +125,15 @@ block B1
A2
block B2
````

*Result:*
````
<div class="a">A1</div>
<div class="b">B1</div>
<div class="a">A2</div>
<div class="b">B2</div>
````

### With different levels
````
@column div .column
Expand All @@ -145,6 +146,7 @@ column
Title 2
content Text 2
````

*Result:*
````
<div class="column">
Expand Down

0 comments on commit 0f93cc6

Please sign in to comment.