-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Documenting the editor #521 #552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
## Customizing the Editor | ||
|
||
By default, the editor is the [Ace](https://ace.c9.io/) editor, but, if desired, the functionality may be overriden by providing a different folder: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was originally intended that the playpen editor was also customizable in the same way the theme is: by providing a folder with files that are named the same. But I am a bit confused because the theme page says that the new theme
folder needs to be next to src
, while I always thought it was inside src
, and when I added a folder next to src
rather than inside, mdBook did not report that it was copying anything.
I generally had trouble getting this functionality working regardless; I only ever recall theme/playpen replacement working if I manually specified the folder in the .toml
. Not sure if bug, or I'm using it wrong, or... but since it's not functionality I can replicate I decided to not document it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not exactly sure how it works either :(
I'm planning to give the HTML renderer a massive makeover some time soon and in the process I'll be able to document how it actually does rendering.
That kind of functionality should be easy to test. We just drop a themes/
directory in the dummy book's src/
(or next to it) and then make sure mdbook
picks it up.
editor = "/path/to/editor" | ||
``` | ||
|
||
Note that for the editor changes to function correctly, the `book.js` inside of the `theme` folder will need to be overriden as it has some couplings with the default Ace editor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what this is saying is that technically you can override the editor, but in doing so you also need to maintain your own patched version of book.js
? That sounds... not ideal 😜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not, but it is the truth. At least at the time that I worked on this, I didn't see any feasible way of making book.js
decoupled. That would require quite a bit of refactoring.
Looks good to me 👍 Regarding the ability to swap out editors... I think it's probably worth removing the |
Documenting the editor rust-lang#521
Fixes #521.