Giter VIP home page Giter VIP logo

kosmosisdire / obsidian-webpage-export Goto Github PK

View Code? Open in Web Editor NEW
751.0 10.0 62.0 3.87 MB

Export html from single files, canvas pages, or whole vaults. Direct access to the exported HTML files allows you to publish your digital garden anywhere. Focuses on flexibility, features, and style parity.

Home Page: https://docs.obsidianweb.net/

License: MIT License

JavaScript 29.69% TypeScript 56.65% CSS 9.59% C++ 3.58% Python 0.49%
html obsidian obsidian-plugin publish

obsidian-webpage-export's Introduction

Hi there ๐Ÿ‘‹

My name is Nathan George, I am a programmer, artist, and musician.

Check out my website!

Top Langs

obsidian-webpage-export's People

Contributors

7mik avatar beelux avatar brinterwastaken avatar h2co3bearcard avatar iyioio avatar jonartis avatar kosmosisdire avatar lukewh avatar ryotaushio avatar thewest123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

obsidian-webpage-export's Issues

About a momentary black screen

Describe the bug
Using the light theme, there is a momentary black screen when viewing a new page via a hyperlink or refresh page on the exported html files. It looks like that the theme has changed. If I use dark theme, it's no problem.

Operating System
I'm using the Microsoft Edge on Win11.

To Reproduce
Steps to reproduce the behavior:

  1. Select an obsidian file that has some hyperlinks.
  2. Export to HTML
  3. Click on the HTML
  4. Use the light theme
  5. Click a hyperlink or refresh page
  6. See error

Add "index.html" export mode

This would add an option alongside the "web styled file names" option, which would create a seperate folder for every file with the file's name and rename each exported file to index.html inside the folder. This would let each file be under a folder path instead of a file path. aka no .html at the end of the url.

UTF-16 encoding may be causing pages to not render sometimes

I tried opening exported pages in github pages, but they didn't render.
After some investigation i found out that the exported files are saved in UTF-16BE

image

I converted them to UTF-8 and now everything works.
Is there a reason to save in UTF-16?

Let user set favicon for exported files

Add option in the plugin settings tab (not the modal) that will let the user select a custom favicon for the exported files. This is the little icon that would show on the tab when opened in a browser.

Execute plugin outside Obsidian / from command line

Hi,

I would like to publish my vault automatically.
Your plugin is great and the only one that really works for me and does not require a ton of third party tool installations.

Is there a way to launch your scripts from outside Obsidian ?
The way I would like to use it is:

  1. Edit my vault on Windows โœ”๏ธ
  2. Automatically push to github each x minutes โœ”๏ธ
  3. On linux, automatically get the files from github โœ”๏ธ
  4. Convert MDs to HTML with your scripts, from a command line โŒ
  5. From a script, Delete HTML files I listed as "Private" โœ”๏ธ
  6. Copy the results in my webserver directory โœ”๏ธ

At this time, I manually launch the conversion in windows from your plugin, then copy the HTML to linux, but I'd rather launch the conversion on linux from a cron job.

Thanks for any hint on how to do that.

Link jump failed

When the publishing folder contains multiple md files, multiple html will be generated. At this time, open the html with double links and click jump. The jump url has an md before the html prefix. This md should be removed, otherwise the link jump fails

Export of linked Files

Is it possible to export linked (.md-) files within a document. Maybe as a checkbox to choose from when exporting. As of now, all links created are clickable in the HTML but lead to an unknown file.
Maybe i just don't get it and need some kind hints. Thanks!

EDIT: I know of the export folder/vault function. This is not what i am looking for as I eitehr don't have the selected documentsin one folder or i just don't want the whole vault to be exported. As said: A checkbox selection of all linked files within the document would be great.

Combine external files when exporting multiple files.

When exporting multiple files with non-injected JS and / or CSS there is always one copy of all the files for every folder. Instead it should combine them and every file should reference one copy of the shared files at the root folder of the export.

Export based on tag(s)

Add possibility to export all files in the vault (or folder) with certain tag(s).

PS: nice plugin, and thanks for your contribution!

Export Vault might not be working

Using either the Ribbon, the right-click menu, or the direct command to export the vault, the only thing that displays is the Export Web page form. The only feature that does work is export to HTML. This works for a single page. Selecting multiple pages and then exporting also does no work -- that is, nothing is exported.

README Contributing typo?

Describe the bug
This sentence in the README is unclear:

So if you are going to work on a feature that already an issue, then please submit an issue instead.

I'm guessing it's meant to say "a feature that isn't already an issue"?

Where is it?

Cant find ur plugin in the plugins list. Im on Android.

Hitting cancel on `Export Vault to HTML` still runs the script

If I click the Export Vault to HTML in the ribbon, I receive a modal popup / dialogue (as expected).

However, it appears you cannot "cancel" this action:

  1. Clicking on the "X" still sends you through to the "Choose the folder dialogue"
  2. Hitting cancel on the "Choose the folder (modal) dialogue" still fires the script.

From what I can tell, the script still runs (opens a tab for every note in the vault), but does not write the files anywhere.

Windows machine.

Example of Error

Add a graph view similar to obsidian's

Add a graph view similar to obsidians that shows the relationship between all the files in the export. This should use a canvas, mimic the physics and draggable nature of the one in obsidian, and should base it's properties and visuals on the ones set in obsidian on export.

The HTML, which is created by the `Export vault to HTML` command has dead links

Hi. First, thank you for developing the amazing plugin :)

I found the strange behavior about Export vault to HTML command. So let me inform you of the details.


Version

1.3.2

Settings

All settings are as default.

Reproduction steps

  1. Create a new vault named webpage-test
  2. Install this plugin
  3. Create a dir directory, and create two files located as follows
./webpage-test
โ”œโ”€โ”€ ๐Ÿ“ dir
โ”‚   โ””โ”€โ”€ file in the dir.md
โ””โ”€โ”€ file.md

file.md

[[file in the dir]]
  1. Run the Export vault to HTML command
  2. Open file.html in the browser

Expected

The link URL is ./dir/file%20in%20the%20dir.html

Actual

The link URL is ./file%20in%20the%20dir.html

image


Kind regards :)

Fix math styles sometimes not exporting correctly

It seems that after export all mjx-math tags get converted to math tags, this leads to

  1. This snippet not working in exports
mjx-math {
    font-size: 120% !important;
}
  1. Weird paddings
    Screenshot_20230318_175247

I currently fix them with this snippet:

math {
    font-size: 120% !important;
}

mjx-math {
    display: none !important;
}

image

jquery error when clicking on a link in outline right sidebar

Thank you for this amazing plugin ! I was able to run it, and I am trying to use it to convert my entire vault into a website that would be an alternative to Obsidian publish. I was previouly trying to use Obsidian-share, but your plugin is better because it converts the output of mathjax, desmos, dataview, and even music-abc plugins seamlessly to html, and it handles callouts nicely !

I had an error in jquery (visible in chrome debugger) because I am trying to integrate the generated html code into a more general website framework that also use the class "internal-link". The error comes when I click on a paragraph title in the outline right panel.

But I finally found a solution :
in the file "webpage.js" just replace the line

$(".internal-link").on("click", function()

with

$("outline-item-contents").on("click", function()

Just because each element of your outline has both css classes "outline-item-content" and ".internal-link", but the latter is far more subject to be also used by divs that do not belonging to the outline column
Hope this helps and regards
Serge

Can't enable plugin...

...as the plugin is looking for the .obsidian folder which is non-existent as I had renamed to .pc before.
I copied the plugin folder to .obsidian as well; still says "path doesn't exist."
-- Win10

Create a styling guide

Create a short styling guide for people wanting to style the toggle, sidebars, or outline. This would include a breakdown of the different classes and variables that can be modified.

This probably won't be created until I settle on a stable setup for all the html and styles.

[BUG]: Exports are empty when files are opened in editing view by default

Hello,

Expected Behavior

The resulting HTML file when exporting a page is not empty

Actual Behavior

HTML file only has empty content tree and dark mode toggle button
image

Occurs when

Default view for new tabs is set to editing view; the problem goes away once this setting is changed to reading view.
image

Possible ways to patch this bug

  1. remind new users to set their new tabs to open in reading view by default
  2. When a file is exported, a tab is temporarily opened and closed for that page. Perhaps code in something to make it automatically

Additional comments

This was very confusing for me to figure out which was why I uninstalled it at first because it didn't work but then I saw that it did work for some people; I think this plugin will be much better appreciated by newcomers given that a decent chunk of people use editing mode by default.

Best Regards,
kelco-chan

Special characters in links or file names cause export to fail

Describe the bug
On one page, the export won't work. Instead nothing happens (with no error message popup shown) and an error gets logged at the console (see below).

With version 1.4.0 of the plugin everything was working fine.

Operating System
macOS 13.2.1

To Reproduce
I don't know how to reproduce the bug, because it happens on only one page.

The page has a Dataview part and a list of internal links (around 150 links, handled by the plugin Waypoint). I use the same "template" (Dataview part and list of internal links) on other pages where this isn't happening.

Screenshots
If applicable, add screenshots here to help explain your problem (just copy paste)

IMPORTANT: Error Log

Uncaught (in promise) URIError: URI malformed
    at decodeURI (<anonymous>)
    at Utils.makePathUnicodeCompatible (plugin:webpage-html-export:6158:12)
    at Utils.parsePath (plugin:webpage-html-export:6124:17)
    at HTMLAnchorElement.eval (plugin:webpage-html-export:7048:42)
    at Function.each (plugin:webpage-html-export:412:28)
    at jQuery2.fn.init.each (plugin:webpage-html-export:300:26)
    at HTMLGenerator.fixLinks (plugin:webpage-html-export:7025:35)
    at HTMLGenerator.getCurrentFileHTML (plugin:webpage-html-export:6845:10)
    at async HTMLExportPlugin.exportFile (plugin:webpage-html-export:7333:18)
    at async HTMLExportPlugin.exportFolder (plugin:webpage-html-export:7391:9)
makePathUnicodeCompatible @ plugin:webpage-html-export:6158
parsePath @ plugin:webpage-html-export:6124
eval @ plugin:webpage-html-export:7048
each @ plugin:webpage-html-export:412
each @ plugin:webpage-html-export:300
fixLinks @ plugin:webpage-html-export:7025
getCurrentFileHTML @ plugin:webpage-html-export:6845

Let user insert custom html into the sidebars.

Add controls in the plugin settings tab to add custom HTML and reorder HTML on the sidebars. And an option to add custom css and js to the files in general.

This control would consist of two columns one for each sidebar. Each column would have reorderable entries, each representing an element in the sidebar. For example the file outline could be moved between the columns and the html for an image could be put above or below it.

[BUG]: Does not export long notes properly

Some of my notes are fairly large, when I try to export them with this plugin, they get cut off

Export Ground truth
image image

If i open the note before exporting and scroll to the bottom it gets exported properly.

Operating System
Linux (EndeavourOS)

Failed to load plugin

Hello!
This looks awesome, but I can't get it working on my end.
I'm on Windows 10 and Default theme. I've installed manually to the plugins folder. It shows up properly on the list of plugins in Obsidian, but when I go to enable the plugin I get a "Failed to load plugin" message.
Thanks for your time :-)

Partially exported files

I have been exporting documents from one of my repositories, but the exported files are being chopped off and not complete when the document is long.

Export fails on Mac and Linux

When trying to export a file (or entire vault), the plugin just open the file in another tab but doesn't create any html file

template dynamic script is not supported

For example, write a templater dynamic command in the document ๏ผš
<%+ tp.date.now() %>
IT Should show the date , but the tp syntax is exported as is, and not correctly parsed tp syntax When exporting html files

Insert <meta charset="utf-8"> by default on generating html.

Is your feature request related to a problem? Please describe.
Depending on the host, the special characters isn't showing properly.

Describe the solution you'd like
On generating .html file, please, add the charset utft8 meta tag on the header section to support all languages:

<meta charset="utf-8">

Additional context
Add any other context or screenshots about the feature request here.

crash when exporting a leaf that contains special external link

Hello, When trying to export my whole wault, the plugin ceased to work after having (perfectly) handled a few files. I managed to solve the issue, and found it was caused by a single file. I edited it, and Finally found the cause :
My .md file contains only one line :
![load file on disk D)](<file:///D:\images\mes tableaux\La violoniste\en cours\recad\00_original.jpg>)

when exporting to HTML, the plugin crashes with this text in the console and does not generale any output :

node:internal/errors:464 Uncaught (in promise) TypeError: File URL path must not include encoded \ or / characters
    at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
    at new NodeError (node:internal/errors:371:5)
    at getPathFromURLWin32 (node:internal/url:1368:15)
    at fileURLToPath (node:internal/url:1420:22)
    at Function.fixPath (plugin:webpage-html-export:8664:41)
    at Function.getTextBase64 (plugin:webpage-html-export:8667:17)
    at HTMLGenerator.getSeperateFilesToDownload (plugin:webpage-html-export:9171:32)
    at async HTMLExportPlugin.exportFile (plugin:webpage-html-export:9667:22)
    at async eval (plugin:webpage-html-export:9614:27)`

Maybe it is caused by the fact that the link contains both slashes and antislashes, which is a bit weird but it is perfectly accepted by Obsidian, and the image is displayed in the app.
Happy new year,
Serge

Checkboxes do not have 'checked' attribute in exported file, hence not styled accordingly.

Hi.
Thanks for the great plugin. Really like how it exports 99.99% close to what I see in Obsidian.
There is one issue with checkboxes, however.
In exported file, all checkboxes are not checked (lacking checked attribute on tag)
Maybe it is because in Obsidian developer tools it is also missing. Not sure how Obsidian tracks which checkboxes are checked.

It can probably be solved by custom CSS. In Minimal theme, checkboxes are styled as input:checked. I may use .is_checked input. Is it possible for plugin to handle this?

Obsidian:
image

Firefox:
image

Unicode character in image paths causes them to not be exported

My internal pictures, that are included in the note with ![[picture.png]] are not exported to html. The html file just shows "picture.png". A subfolder for the picture file, as described in the read.mw file is not created either.

Is there a specific way/code, I have to include pictures in the obsidian note?

Thanks

Export of large or hard to CSS parse .md files fails.

Export of large or hard to parse .md files fails when you export a full vault. It works fine if you open the file and export it as a single file. Maybe a longer delay would be required after opening the file until it has fully loaded the CSS parsing? With some very long files, it fails to export all chapters. It seems like it times out before finishing the howl file.
Thanks for your great work!

image

Error: Path does not exist

Describe the bug
When exporting a page, some errors occurs (see the screenshot attached). Seems like the plugin is referring to some non-exist CSS files. Those file did exist before, but I have already removed them.

Operating System

  • macOS 12.6.1
  • Obsidian 1.1.14

To Reproduce
Execute command Export current file to HTML.

Screenshots
image

IMPORTANT: Error Log

image

Recursive export of linked files

For me, it would be awesome (and super helpful) if we could also recursively export web pages from a given file. For example, suppose we have a document named index.md:

# Index
[[sample]]

and sample.md:

# Sample 
some text...

If we export the file index.md, we can get both index.html and sample.html. One conceivable problem is that we might run into a cycle (e.g. the sample.md also contains a link to the index.md). But we can probably just stop the recursion if we come across a file that has been encountered before.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.