Skip to content

Commit

Permalink
add extension settings (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
callmephilip authored Sep 7, 2024
1 parent da4751f commit fd8a513
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ All notable changes to the "html2ft" extension will be documented in this file.
## 0.2.0

- Run conversion locally

## 0.3.0

Support extension settings
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ Initial release
### 0.2.0

Run conversion locally

### 0.3.0

Support extension settings
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "html2ft",
"displayName": "html2ft",
"description": "Convert HTML to FastHTML FT",
"version": "0.2.0",
"version": "0.3.0",
"publisher": "PhilipNuzhnyi",
"repository": "https://github.com/callmephilip/html2ft",
"license": "MIT",
Expand All @@ -29,6 +29,16 @@
"group": "modification@2"
}
]
},
"configuration": {
"title": "HTML2FT",
"properties": {
"html2ft.attrs1st": {
"type": "boolean",
"default": false,
"description": "Indicates if element attributes should be displayed before children elements"
}
}
}
},
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export function activate(context: vscode.ExtensionContext) {
const originalText = document.getText(selection);

try {
const convertedText = html2ft(originalText);
const convertedText = html2ft(
originalText,
vscode.workspace.getConfiguration("html2ft").get("attrs1st")
);
editor.edit((editBuilder) => {
editBuilder.replace(selection, convertedText);
});
Expand Down

0 comments on commit fd8a513

Please sign in to comment.