Skip to content

Commit b44ceb9

Browse files
datho7561angelozerr
authored andcommitted
Update documentation from wiki
Add new documentation from the wiki. Add links to new documentation in the settings section of `package.json` Links between document pages are replaced during runtime so that they work property with vscode. Closes #328 Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent c24d888 commit b44ceb9

18 files changed

+922
-593
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ The following settings are supported:
5959
* `xml.format.enabled` : Enable/disable ability to format document. Default is `true`.
6060
* `xml.format.emptyElements` : Expand/collapse empty elements. Default is `ignore`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatemptyelements) for more information.
6161
* `xml.format.enforceQuoteStyle`: Enforce `preferred` quote style (set by `xml.preferences.quoteStyle`) or `ignore` quote style when formatting. Default is `ignore`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatenforcequotestyle) for more information.
62-
* `xml.format.joinCDATALines` : Set to `true` to join lines in CDATA content during formatting. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatjoincdatalines-) for more information.
63-
* `xml.format.joinCommentLines` : Set to `true` to join lines in comments during formatting. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatjoincommentlines-) for more information.
62+
* `xml.format.joinCDATALines` : Set to `true` to join lines in CDATA content during formatting. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatjoincdatalines) for more information.
63+
* `xml.format.joinCommentLines` : Set to `true` to join lines in comments during formatting. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatjoincommentlines) for more information.
6464
* `xml.format.joinContentLines` : Normalize the whitespace of content inside an element. Newlines and excess whitespace are removed. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatjoincontentlines) for more information.
6565
* `xml.format.preserveAttributeLineBreaks`: Preserve line breaks that appear before and after attributes. This setting is overridden if `xml.format.splitAttributes` is set to `true`. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatpreserveattributelinebreaks) for more information.
66-
* `xml.format.preserveEmptyContent`: Preserve empty content/whitespace in a tag. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatpreserveemptycontent-) for more information.
66+
* `xml.format.preserveEmptyContent`: Preserve empty content/whitespace in a tag. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatpreserveemptycontent) for more information.
6767
* `xml.format.preservedNewLines`: Preserve new lines that separate tags. The value represents the maximum number of new lines per section. A value of 0 removes all new lines. Default is `2`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatpreservednewlines) for more information.
68-
* `xml.format.spaceBeforeEmptyCloseTag`: Insert space before end of self closing tag. \nExample:\n ```<tag/> -> <tag />```. Default is `true`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatspacebeforeemptyclosetag-) for more information.
69-
* `xml.format.splitAttributes` : Split multiple attributes each onto a new line. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatsplitattributes-) for more information.
68+
* `xml.format.spaceBeforeEmptyCloseTag`: Insert space before end of self closing tag. \nExample:\n ```<tag/> -> <tag />```. Default is `true`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatspacebeforeemptyclosetag) for more information.
69+
* `xml.format.splitAttributes` : Split multiple attributes each onto a new line. Default is `false`. See [here](https://github.com/redhat-developer/vscode-xml/wiki/Formatting#xmlformatsplitattributes) for more information.
7070
* `xml.preferences.quoteStyle`: Preferred quote style to use for completion: `single` quotes, `double` quotes. Default is `double`.
7171
* `xml.autoCloseTags.enabled` : Enable/disable autoclosing of XML tags. Default is `true`. \n\nIMPORTANT: Turn off `#editor.autoClosingTags#` for this to work.
7272
**Note**: `editor.autoClosingBrackets` must be turned off to work.

docs/CodeLens.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
## Code Lens
3+
4+
### DTD features
5+
6+
Code lens is provided in `.dtd` files to show where elements defined in the DTD are referenced.
7+
For instance, in the following code:
8+
9+
```xml
10+
<!ELEMENT letter (to, from, title, body)>
11+
<!ELEMENT to (#PCDATA)>
12+
<!ELEMENT from (#PCDATA)>
13+
<!ELEMENT title (#PCDATA)>
14+
<!ELEMENT body (#PCDATA)>
15+
```
16+
17+
There will be a code lens entry after the first line that points from the
18+
definition of the element `to` to where it is used in the definition of the
19+
element `letter`.
20+
21+
Here is a demonstration of the above Code Lens:
22+
23+
![A letter DTD element is declared, which consists of to, from title, and body elements. The definitions for these sub elements have a code lens above, which allows ofr navigating to the letter element declaration.](./images/CodeLens/DTDElementCodeLens.gif)
24+
25+
### XSD Features
26+
27+
Code lens is also provided in `.xsd` files. It shows where top level types
28+
and elements are referenced. For instance, in the following code:
29+
30+
```xml
31+
<?xml version="1.0" encoding="UTF-8"?>
32+
<xs:schema
33+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
34+
targetNamespace="http://example.org/my-example"
35+
xmlns:NS="http://example.org/my-example">
36+
<xs:element
37+
name="root-element"
38+
type="NS:yell" />
39+
<xs:simpleType name='yell'>
40+
<xs:restriction base='xs:string'>
41+
<xs:pattern value='[A-Z]+!'></xs:pattern>
42+
</xs:restriction>
43+
</xs:simpleType>
44+
</xs:schema>
45+
```
46+
47+
There will be a code lens above the line where the `yell` type is defined
48+
that points to where it is referenced when defining the `root-element` element.
49+
50+
Here is a demonstration of the above Code Lens:
51+
52+
![The code lens provides the number of references and links to references for an `xs:simpleType`.](./images/CodeLens/XSDTypeCodeLens.gif)
53+
54+
Here is a demonstration of the code lens for `xs:element`:
55+
56+
![An element root is declared that contains an element boot. Above the declaration of boot, there is a code lens that links to the reference in root.](./images/CodeLens/XSDElementCodeLens.gif)

0 commit comments

Comments
 (0)