-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aff8106
Showing
16 changed files
with
5,752 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# vscode | ||
.vscode | ||
|
||
# Intellij | ||
*.iml | ||
.idea | ||
|
||
# npm | ||
node_modules | ||
|
||
# Don't include the compiled main.js file in the repo. | ||
# They should be uploaded to GitHub releases instead. | ||
main.js | ||
|
||
# Exclude sourcemaps | ||
*.map | ||
|
||
# obsidian | ||
data.json | ||
|
||
# Exclude macOS Finder (System Explorer) View States | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 kalvn | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Obsidian Export to HTML | ||
This [Obsidian](https://obsidian.md) plugin allows you to export the content of a note as HTML, either to the clipboard or to a new HTML file. | ||
|
||
During the export, images will be copied over in base 64 format. | ||
|
||
This plugin is a work in progress but it already works great in most cases. Some edge cases with inline image exports will be improved. | ||
|
||
## Installation | ||
Follow the steps below to install **Obsidian Export to HTML**. | ||
|
||
1. Search for *Export to HTML* in Obsidian's community plugins browser | ||
2. Enable the plugin in your Obsidian settings (find *Export to HTML* under *Community plugins*). | ||
3. (Optional) If you plan to use it often, in the *Hotkeys* settings, search for *Export to HTML* and bind actions to keyboard shortcuts. | ||
|
||
## How to use | ||
Open the command palette (press <key>CTRL+P</key> if you use a keyboard) and type *Export to HTML*. | ||
|
||
- Select *Export to HTML: Copy to clipboard as HTML* to copy your note as HTML in your clipboard. You can then paste it in an email or in a Word document and the style will be kept. | ||
- Select *Export to HTML: Download as HTML* to download your note as an HTML file. | ||
|
||
## Manual installation | ||
- Download [the latest release](https://github.com/kalvn/obsidian-export-to-html/releases) and unzip it. | ||
- Copy over `main.js`, `manifest.json` to your vault `VaultFolder/.obsidian/plugins/export-to-html/`. | ||
|
||
## How to contribute | ||
- Clone this repo. | ||
- Make sure your NodeJS is at least v16 (`node --version`). | ||
- `npm i` or `yarn` to install dependencies. | ||
- `npm run dev` to start compilation in watch mode. | ||
|
||
## External packages used | ||
- Starter template: [Obsidian sample plugin](https://github.com/obsidianmd/obsidian-sample-plugin) | ||
- Markdown to HTML: [Marked](https://github.com/markedjs/marked) | ||
- CSS: [Github Markdown CSS](https://github.com/sindresorhus/github-markdown-css) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import esbuild from 'esbuild'; | ||
import process from 'process'; | ||
import builtins from 'builtin-modules'; | ||
|
||
const banner = | ||
`/* | ||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD | ||
if you want to view the source, please visit the github repository of this plugin | ||
*/ | ||
`; | ||
|
||
const prod = (process.argv[2] === 'production'); | ||
|
||
const context = await esbuild.context({ | ||
banner: { | ||
js: banner, | ||
}, | ||
entryPoints: ['src/main.ts'], | ||
bundle: true, | ||
external: [ | ||
'obsidian', | ||
'electron', | ||
'@codemirror/autocomplete', | ||
'@codemirror/collab', | ||
'@codemirror/commands', | ||
'@codemirror/language', | ||
'@codemirror/lint', | ||
'@codemirror/search', | ||
'@codemirror/state', | ||
'@codemirror/view', | ||
'@lezer/common', | ||
'@lezer/highlight', | ||
'@lezer/lr', | ||
...builtins], | ||
format: 'cjs', | ||
target: 'es2018', | ||
logLevel: 'info', | ||
sourcemap: prod ? false : 'inline', | ||
treeShaking: true, | ||
outfile: 'main.js', | ||
minify: prod, | ||
}); | ||
|
||
if (prod) { | ||
await context.rebuild(); | ||
process.exit(0); | ||
} else { | ||
await context.watch(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import neostandard from 'neostandard'; | ||
|
||
export default [ | ||
...neostandard({ | ||
semi: true, | ||
ts: true | ||
}), | ||
{ | ||
ignores: [ | ||
'main.js', | ||
'node_modules/*' | ||
] | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"id": "export-to-html", | ||
"name": "Export to HTML", | ||
"version": "1.0.0", | ||
"minAppVersion": "0.15.0", | ||
"description": "Export your Markdown notes as HTML, directly in the clipboard or as a file.", | ||
"author": "kalvn", | ||
"authorUrl": "https://kalvn.net", | ||
"fundingUrl": "https://paypal.me/kalvn/5", | ||
"isDesktopOnly": false | ||
} |
Oops, something went wrong.