Skip to content

Commit

Permalink
ready for official release
Browse files Browse the repository at this point in the history
  • Loading branch information
Benature committed Mar 18, 2024
1 parent 547e535 commit 7786443
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Or you can consider to bind custom hotkeys to those commands according to [#29](
- [List](#list)
- [Links](#links)
- [Copy / OCR issues](#copy--ocr-issues)
- [Academic/Study](#academicstudy)
- [Academic / Study](#academic--study)
- [Advanced custom](#advanced-custom)
- [Others](#others)
- [Support](#support)
Expand Down Expand Up @@ -103,15 +103,15 @@ Or you can consider to bind custom hotkeys to those commands according to [#29](
| Replace **ligature** | Replace [ligature](https://en.wikipedia.org/wiki/Ligature_(writing)) to Non-ligature [#24](https://github.com/Benature/obsidian-text-format/issues/24) |


### Academic/Study
### Academic / Study

| Command | Description |
| ---------------------------------------------- | ---------------------------------------------------------------------------- |
| Convert selection into **Anki** card format | [#32](https://github.com/Benature/obsidian-text-format/pull/32) |
| Remove citation index | e.g., `A research [12] about notes` => `A research about notes` |
| Get **Zotero** note from clipboard and paste ⚙️ | See [below ⬇️](#zotero-format) |
| Convert single letter into **math** mode | e.g. convert `P` into `$P$` (latex), apply for all single letter except `a`. |
| Convert **Mathpix** array to markdown table | Convert latex array generated by Mathpix to markdown table format |
| Command | Description |
| ------------------------------------------------------ | ---------------------------------------------------------------------------- |
| Convert selection into **Anki** card format | [#32](https://github.com/Benature/obsidian-text-format/pull/32) |
| Remove citation index | e.g., `A research [12] about notes` => `A research about notes` |
| Get **Zotero** note from clipboard and paste ⚙️ | See [below ⬇️](#zotero-format) |
| Detect and convert characters to **math mode** (LaTeX) | e.g. convert `P` into `$P$` (latex), apply for all single letter except `a`. |
| Convert **Mathpix** array to markdown table | Convert latex array generated by Mathpix to markdown table format |



Expand Down
9 changes: 8 additions & 1 deletion docs/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,15 @@ When the settings are
+ 中文标点异常。比如是复制的文本,或者是 OCR 的结果。
```

...
# Academic / Study

## Math mode

```diff
- Suppose variable x1 add x2 equals to variable Y.
+ Suppose variable $x_1$ add $x_2$ equals to variable $Y$.


...

> Note: The document is still under development.
5 changes: 1 addition & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ export default class TextFormat extends Plugin {
}

log(...args: any[]): void {
// TODO: add verbose log setting
if (true) {
console.log(...args);
}
Expand Down Expand Up @@ -664,7 +665,6 @@ export default class TextFormat extends Plugin {
this.log("adjustRange", adjustRange)
const selectedText = editor.getRange(adjustRange.from, adjustRange.to);
this.log("selectedText", selectedText)
// let cursorOffset = 0;
//: MODIFY SELECTION
let replacedText: string;
try {
Expand All @@ -676,14 +676,11 @@ export default class TextFormat extends Plugin {
if (adjustRange.from.line == adjustRange.to.line) {
const headingRes = headingLevel(selectedText, context);
replacedText = headingRes.text;
// cursorOffset = headingRes.offset;
} else {
replacedText = "";
// cursorOffset = 0;
selectedText.split("\n").forEach((line, index) => {
const headingRes = headingLevel(line, context, true);
replacedText += headingRes.text + "\n";
// cursorOffset += headingRes.offset;
});
replacedText = replacedText.slice(0, -1); // remove the last `\n`
}
Expand Down
2 changes: 1 addition & 1 deletion manifest-beta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-text-format",
"name": "Text Format",
"version": "3.0.0-b4",
"version": "3.0.0-b5",
"minAppVersion": "0.9.7",
"description": "Format text such as lowercase/uppercase/capitalize/titlecase, converting order/bullet list, removing redundant spaces/newline characters.",
"author": "Benature",
Expand Down

0 comments on commit 7786443

Please sign in to comment.