Skip to content

Commit a8e7e2f

Browse files
authored
Merge pull request #7 from MeepTech/v1.1
V1.1 Mobile Specific settings, Case sensitivity, MD file override option, View types list, Errors list, and general cleanup.
2 parents 6259501 + b600bbf commit a8e7e2f

File tree

8 files changed

+2164
-304
lines changed

8 files changed

+2164
-304
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
# Don't include the compiled main.js file in the repo.
1212
# They should be uploaded to GitHub releases instead.
1313
main.js
14+
/build
1415

1516
# Exclude sourcemaps
1617
*.map

README.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,50 @@ This is a plugin for [Obsidian](https://obsidian.md) to allow associaton of file
44

55
## Configuration
66

7-
Configuration is done though a single setting which takes a json object as a parseable string.
7+
File types are associated with Obsidian's 'view' types using the main *Confg* setting. This setting takes a single json object as a parseable string.
88

9-
Ex: "`{"markdown": ["", "txt", "html", "js", "css", "ts", "yaml"]}`"
9+
- Ex: "`{"markdown": ["", "txt", "html", "js", "css", "ts", "yaml", "md"]}`"
1010

11-
The above example will assign the extensions: "", "txt", "html", "js", "css", "ts", and "yaml" to the view registered with the name `markdown`.
11+
> This will assign the extensions: "", "txt", "html", "js", "css", "ts", and "yaml" to the view registered with the name `markdown`.
1212
13-
### Defaults
13+
### Mobile Specific Settings
14+
Mobile-specific settings can be enabled using the *Mobile Settings* toggle.
15+
16+
Setting the *Mobile Config* to empty/undefined/null will cause the mobile file-types list to default to the desktop file-types list. Case sensitivity defaults to false.
1417

15-
The default settings assign the extensions: "", "txt", "html", "js", "css", "ts", "yaml" to Obsidian's `markdown` view.
18+
### Allow md Extension Override
19+
The *Allow md Extension Override* toggle allows the user to override the default Obsidian behavior of assigning the `markdown` view to the `.md` extension. This setting is disabled by default to avoid confusion and unexpected behavior. When disabled, the `.md` extension will always be assigned to the `markdown` view and any attempt to assign it to another view will be ignored.
1620

17-
### Notes
21+
### Defaults
22+
23+
The default settings assign the following to Obsidian's `markdown` view:
24+
```
25+
"", "txt", "html",
26+
"js", "css", "ts",
27+
"jsx", "tsx", "yaml",
28+
"yml", "sass", "scss",
29+
"tex", "json", "md"
30+
```
31+
32+
## Extra Features
33+
For convenience and debugging purpouses; This plugin also provides:
34+
- A list of all currently known view types and their associated file extensions for the current vault.
35+
- A list of all errors related to the current plugin configuration.
36+
This infomation can be found at the bottom of the plugin settings tab.
37+
38+
## Compatibility and Debugging
39+
The plugin should provide a pop up error message, as well as a consistent error message under the plugin settings tab; detailing any incompatibilities with the current configuration. Any errors in the settings tab indicate that a file extension specified in your configuration setting has not been set (any valid extensions settings are still applied). These errors along with the lists of current extension associations and view types should allow you to fine-tune support for other plugins that add new view types or try to take control of other extensions; such as the *Code Files* plugin.
40+
You can also use the *Mobile Specific* settings to augment extension support for plugins that only work on desktop.
41+
42+
## Notes
1843
- The `markdown` view is the default view Obsidian uses for "md" files.
1944
- The "md" extension cannot be modified currently using this plugin and will always be set to the `markdown` view.
45+
- All entered extensions are case-insensitive.
46+
- "" (empty string) is a valid extension and will be treated as a file with no extension.
47+
- If left empty while enabled, the mobile config will default to the desktop config.
48+
- The active profile (desktop vs mobile) is indicated with superscript text in the settings tab.
49+
- Items in the views and extensions list under the settings tab can be copied to the clipboard by clicking on them.
50+
- The plugin updates extensions in real-time whenever it detects a new valid config. This means you may see pop up errors while editing the config, but as long as there are no consistent errors in the settings tab when you are done editing the config then the plugin should be working as intended.
51+
- The Allow md Extension Override toggle applies to both desktop and mobile settings (when enabled).
52+
2053

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"id": "obsidian-custom-file-extensions-plugin",
33
"name": "Custom File Extensions Plugin",
4-
"version": "1.0.1",
4+
"version": "1.1.0",
55
"minAppVersion": "0.10.12",
66
"description": "Associate views with custom file extensions via settings.",
77
"author": "Meep.Tech",
88
"authorUrl": "https://github.com/Meep-Tech/",
99
"isDesktopOnly": false
10-
}
10+
}

0 commit comments

Comments
 (0)