cimsta / obsidiosaurus Goto Github PK
View Code? Open in Web Editor NEWObsidian -> Docusaurus Converter
Home Page: https://cimsta.github.io/obsidiosaurus-docs/
License: MIT License
Obsidian -> Docusaurus Converter
Home Page: https://cimsta.github.io/obsidiosaurus-docs/
License: MIT License
Add docs versioning support
https://docusaurus.io/docs/versioning
website
├── sidebars.json # sidebar for the current docs version
├── docs # docs directory for the current docs version
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
│ └── hello.md # https://mysite.com/docs/next/hello
├── versions.json # file to indicate what versions are available
├── versioned_docs
│ ├── version-1.1.0
│ │ ├── foo
│ │ │ └── bar.md # https://mysite.com/docs/foo/bar
│ │ └── hello.md
│ └── version-1.0.0
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/1.0.0/foo/bar
│ └── hello.md
├── versioned_sidebars
│ ├── version-1.1.0-sidebars.json
│ └── version-1.0.0-sidebars.json
├── docusaurus.config.js
└── package.json
Currently its not possible to create Blog posts in Obsidian for Docusaurus.
Based on the first folder, check if name is "blog" or is ending "-blog" (for multiple blog support) -> start conversion and copy files to new location
Obsidian File - Frontmatter:
---
title: Welcome Docusaurus v2
description: This is my first post on Docusaurus 2.
slug: welcome-docusaurus-v2
authors:
name: Joel Marcey
title: Co-creator of Docusaurus 1
url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png
image: https://i.imgur.com/mErPwqL.png
hide_table_of_contents: false
---
best to create a template for this
https://docusaurus.io/docs/blog
https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog#markdown-front-matter
What I'm trying to achieve is one docusaurus instance serving two distinct docs (multi-instance), where each docs instance is versioned.
Currently I'm using Obsidian to write any docs (also using i18n) and Obsidiosaurus to push it to Docusaurus to fill up the current/next docs. Setting a version happens within Docusaurus and this is totally fine with me.
But when using versioning, two major downsides arise in the areas of Obsidiosaurus:
The idea:
This allows to write markdown files (that may or may not include assets) in obsidian and export them using obsidiosaurus into docusaurus as the current/next version. You can then version your docs using docusaurus but keep obsidian as a nice markdown editor.
When adding a file in the markdown that is saved in the /assets folder and the file is later on being removed (from the /assets folder as well as the reference within the markdown file), Obsidiosaurus runs into the following error:
Error: ENOENT: no such file or directory, copyfile '/Users/jp-performance/Desktop/wiki/vault/assets/example.svg' -> '/Users/jp-performance/Desktop/wiki/website/static/assets/example.svg'.
The markdown files itself are converted correctly.
After manually deleting the respective asset in the assetInfo.json, the conversion process finishes without throwing an error.
Currently there are a few issues regarding Exacalidraw Images
Cant have number in name e.g. "2_abc.excalidraw" also dot: "ab.cd.excalidraw"
"abc.excalidraw.md" is okay
Also, the deletion process after renaming or updating drawing is not working correctly.
Allow images to be resized.
![xyz|512x256](../assets/xyz.jpg)
Sets width to 512and height to 256 px
<img src={require('./xyz.jpg').default} alt="xyz" width="512" height="512"/>
I have an image in my Obsidian notes that I display with the following line:
![](/assets/24D1-4L01-M1.png)
My compilation step fails with the error:
Cause: Image static/assets/D1-A04-M1.webp used in docs/main/vivoChips/Chips.md not found.
Details:
Error: Image static/assets/D1-A04-M1.webp used in docs/main/vivoChips/Chips.md not found.
at async Promise.all (index 0)
For whatever reason, during the compilation step, the first two numbers are getting chopped off of my image name. In /website/docs/main/api.md the image is embedded as:
![24D1-A04-M1](//assets/D1-A04-M1.webp)
Is this expected behavior? Can images not begin with numbers?
When I embed an Excalidraw image to my documentation, both the dark and light versions of that image are imported to my Docusaurus website.
Here's a sample showing a page with a single embedded in Obsidian. When published to Docusaurus, two versions are included in the page at the same time.
Obsidian screen:
Docusaurus website in light mode:
Docusaurus website in dark mode:
Firefox developer tools shows the image is in the DOM twice:
Has anyone else seen this?
Automate the workflow for sidebar creation based on the first folders in Obsidian "docs" Directory.
Changes to sidebar.js:
const sidebars = {
A: [{type: 'autogenerated', dirName: 'A'}],
X: [{type: 'autogenerated', dirName: 'X'}],
...
docusaurus.config.js:
const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
items: [
{
type: 'doc',
docId: 'A/a',
position: 'left',
label: 'a',
},
{
type: 'doc',
docId: 'X/x',
position: 'left',
label: 'x',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
type: 'localeDropdown',
position: 'right',
},
],
},
module.exports = config;
Given the following structure where project1
is a single docs instance as well as project2
:
- docs
- project1
- dev-docs
- user-docs
- project2
- dev-docs
- hello-world.md
- user-docs
the currently generated i18n path looks the following way: i18n/en/docusaurus-plugin-content-docs/project2/current/dev-docs
The path needed for successfully using i18n in an multi-instance setup is: i18n/en/docusaurus-plugin-content-docs-project2/current/dev-docs
It would be great if one could specify in the settings the path to the individual docs instance and their respective id. This way you should be able to generate the correct i18n path.
When renaming .md-files in obsidian and pushing them using obsidiosaurus, I get orphaned .md-files in docusaurus.
Example after first push and before renaming and pushing again:
Obsidian structure:
- docs
- hello-world.md
Docusaurus structure:
- docs
- hello-world.md
Example after renaming and pushing:
Obsidian structure:
- docs
- hello-world-renamed.md
Docusaurus structure:
- docs
- hello-world.md
- hello-world-renamed.md
It would be great if orphaned files in docusaurus were prevented.
When I process the assets in markdown, the assets in the markdown line are replaced. For example:
assets/356a3f33b6ce01782efc24e6a2471f69_MD5.jpeg
is replaced with:
assets/a3f33b6ce01782efc24e6a2471f69_MD5.webp
I scanned the code, and the replacement happens here:
obsidiosaurus/src/markdownProcessor.ts
Lines 166 to 168 in 2060719
Should I skip this function? I'm not sure of the impact of those lines of code.
Currently, it is possible to create the translated files directly in Obsidian with a separate endings e.g.: X/File1__en.md, X/File1__de.md
This gets a bit messy when you have many files and languages.
A better approach would be to a have the option for File Folders. They don't get published in the sidebar, their only intent is to group the files together.
In Obsidian it would look like this: X/File1/File1__en.md, X/File1/File1__de.md, ...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.