Skip to content

Commit

Permalink
Setting ReadMe and more info updated (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmahend1 authored Feb 25, 2024
1 parent fc55ec8 commit ee4aae3
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Stable

## 4.4.1: 25-Feb-2024

- **Attributes In Newline Threshold** setting information added.

## 4.4.0: 25-Feb-2024

- **Attributes In Newline Threshold** setting added.
Expand Down
63 changes: 48 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,57 @@ Minimizes XML.

These will be for **Prettify XML** command.

| Setting Key | Default Value | Description |
|-------------------------------------------------------------|---------------|-------------------------------------------------|
| prettyxml.settings.indentSpaceLength | 4 | No. of spaces for indentation. |
| prettyxml.settings.useSingleQuotes | false | Use ' instead of \" |
| prettyxml.settings.useSelfClosingTag | true | If no child nodes then self closing tag /> |
| prettyxml.settings.formatOnSave | false | Enable format on save |
| prettyxml.settings.allowSingleQuoteInAttributeValue | true | Allows ' in attribute values instead of \' |
| prettyxml.settings.addSpaceBeforeSelfClosingTag | true | Adds space before self closing tag |
| prettyxml.settings.wrapCommentTextWithSpaces | true | Wraps comment text with a single space |
| prettyxml.settings.allowWhiteSpaceUnicodesInAttributeValues | true | Allows white space unicodes in attribute values |
| prettyxml.settings.positionFirstAttributeOnSameLine | true | Position first attribute on same line. |
| prettyxml.settings.positionAllAttributesOnFirstLine | false | Position all attributes on first line |
| prettyxml.settings.preserveWhiteSpacesInComment | false | Preserves whitespaces in a comment |
| prettyxml.settings.addSpaceBeforeEndOfXmlDeclaration | false | Add space before end of XML declaration |
| prettyxml.settings.enableLogs | false | Enables logs |
| Setting Key | Default Value | Description |
|-------------------------------------------------------------------------------------|---------------|----------------------------------------------------------------|
| prettyxml.settings.indentSpaceLength | 4 | No. of spaces for indentation. |
| prettyxml.settings.useSingleQuotes | false | Use ' instead of \" |
| prettyxml.settings.useSelfClosingTag | true | If no child nodes then self closing tag /> |
| prettyxml.settings.formatOnSave | false | Enable format on save |
| prettyxml.settings.allowSingleQuoteInAttributeValue | true | Allows ' in attribute values instead of \' |
| prettyxml.settings.addSpaceBeforeSelfClosingTag | true | Adds space before self closing tag |
| prettyxml.settings.wrapCommentTextWithSpaces | true | Wraps comment text with a single space |
| prettyxml.settings.allowWhiteSpaceUnicodesInAttributeValues | true | Allows white space unicodes in attribute values |
| prettyxml.settings.positionFirstAttributeOnSameLine | true | Position first attribute on same line. |
| prettyxml.settings.positionAllAttributesOnFirstLine | false | Position all attributes on first line |
| prettyxml.settings.preserveWhiteSpacesInComment | false | Preserves whitespaces in a comment. |
| prettyxml.settings.addSpaceBeforeEndOfXmlDeclaration | false | Add space before end of XML declaration. |
| [prettyxml.settings.attributesInNewlineThreshold](#attributes-in-newline-threshold) | 1 | Attributes count threshold to position attributes in newlines. |
| prettyxml.settings.enableLogs | false | Enables logs |

![Settings Image.](./images/settings.png)

### Attributes In Newline Threshold

Example:

Value = 2

#### Input#1

```xml
<Element Attribute1="Value1" Attribute2="Value2" />
```

#### Output#1

```xml
<Element Attribute1="Value1" Attribute2="Value2" />
```

#### Input#2

```xml
<Element Attribute1="Value1" Attribute2="Value2" Attribute3="Value3" />
```

#### Output#2

```xml
<Element Attribute1="Value1"
Attribute2="Value2"
Attribute3="Value3"/>
```

---

## Requirements
Expand Down
Binary file modified images/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"readme": "https://github.com/pmahend1/PrettyXML/blob/main/README.md",
"description": "XML formatter extension for Visual Studio Code. Formats XML documents just like Visual Studio.",
"version": "4.4.0",
"version": "4.4.1",
"publisher": "PrateekMahendrakar",
"repository": {
"url": "https://github.com/pmahend1/prettyxml.git"
Expand Down Expand Up @@ -187,7 +187,7 @@
8,
9
],
"markdownDescription": "Attributes count threshold to position attributes in newlines. Default is *1*. This setting only works when **Position first attribute on same line** is enabled.\n\nFor example if threshold=2, all attributes will be on same line if an element has only 2 attributes,\n\notherwise each attribute will be placed on newline."
"markdownDescription": "Attributes count threshold to position attributes in newlines. Default is *1*. This setting only works when **Position first attribute on same line** is enabled.\n\nFor example if threshold=2, all attributes will be on same line if an element has only 2 attributes,\n\notherwise each attribute will be placed on newline.\n\nMore Info: [GitHub](https://github.com/pmahend1/PrettyXML?tab=readme-ov-file#attributes-in-newline-threshold)"
},
"prettyxml.settings.enableLogs": {
"type": "boolean",
Expand Down

0 comments on commit ee4aae3

Please sign in to comment.