Code Monkey home page Code Monkey logo

docusaurus-plugin-docs-editor's People

Contributors

jlvandenhout avatar josh-cena avatar lucas-tortora 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

Watchers

 avatar  avatar

docusaurus-plugin-docs-editor's Issues

Add support for admonitions

Currently there is no support for Docusaurus admonitions. There is a remark plugin that supports admonitions directly, however this is only compatible with older versions of remark. As we would like to target newer versions of remark, we could use this plugin to parse admonitions.

Provide a way to add images

Add an image to the content by clicking a button and providing the URL to the picture. These resources should also be committed to the branch and included in the eventual pull request.

Make the GitHub login flow more robust

Currently the flow just checks if there is a token already in local storage, before opening the editor, and if it is not there it starts a basic GitHub web application flow without any error checking or recovery.

Ideally the token would be stored in memory instead of in the local storage and have its own endpoint. Also the flow should not only be initiated at page load, but also for example whenever a GitHub API call reports an unauthorized error. Necessary resources like the Client ID, the authentication endpoint, the endpoint to swap the code for an access token, should be configurable from the Docusaurus Plugin configuration.

Prevent loss of progress if authorization is required to finish a GitHub request

Currently if for some reason we need to authorize again with GitHub, any unsaved progress is lost as the authorization flow navigates away from the webpage. A possible solution is to use local storage to temporarily save progress while authorizing. This would also allow to save the action that failed, so it can be retried after authorization automatically.

'Save' does not save anything during 'Local testing'

Hello,

I tried 'Local testing' of this plugin as described in https://github.com/jlvandenhout/docusaurus-plugin-docs-editor#local-testing.

I click on "Save" and nothing happens. I expected that "Save" must make the changes to the site as seen via http://localhost:3000, but this doesn't happen....

Perhaps I need to fork https://github.com/jlvandenhout/docusaurus-plugin-docs-editor.git to my own repository before cloning it to local dir for "Save" to work? (just guessing).

Create a default page for the login page

Currently while in the process of logging in to GitHub and while the editor is not shown, a blank page is shown. It would be nice to present some sort of loading screen while waiting for responses and report errors when they occur with a possibility to recover.

Implement visual feedback for save and submit actions

Currently there is no visual response for the save or submit buttons. Some ideas are:

  • Disable the save button or have an indication when the contents of the file have not been changed with regard to the remote content.
  • Change the submit button to something more useful after a PR is successfully created, a link to the PR for example.
  • Indicate when a save or submit was successful.

Is it still alive? (Problems with usage)

Hello!

I have some issues with usage of package, is it still alive for usage?
(its great, that you implemented the idea of WYSIWYG editing, but it would be pity if it doesn't work now)

Problem 1: Live Preview

There is the link to Live Preview At the top of README

I follow steps on playground, but can't reach some visible result πŸ€”

(What am I doing wrong? Or it's trouble with package/demo?)

Looks like that I have problem with url of article, or may be some required credentials (but should it required for "get started live preview? πŸ€”")

ZWxFRZAS5t.mp4

Problem 2: Setup

Next, I've tried to setup package locally for my docusaurus project (with special clientId from OAuthApp and with special authToken which was received by gatekeeper)

But again - there is problem with usage of package

It would be great to add more details for setuping, especially for users, who doesn't have a lot of experience with OAuthApps and Github credentials

image

Config

Docusaurus.config.js
image

Dependencies
Also, at first it was installed as "@jlvandenhout/docusaurus-plugin-docs-editor": "jlvandenhout/docusaurus-plugin-docs-editor" and it need to specify version
image


P.S.

Thank for your efforts, still hope that package is ready for usage!

Configure remark and rehype to render Markdown correctly

Currently the Markdown output that the editor produces differs from the original Markdown input, even when nothing is changed. The goal is to configure the HTML to Markdown pipeline such that it produces similar output if nothing is changed.

A list of inconsistencies that need to be fixed:

  • Support for code blocks highlighting
  • List item marker should be - instead of *

Make the editor responsive

Currently the editor is designed for desktop screens only. To allow for different sizes, here are some suggestions:

  • Collapse the menu from least to most accessed groups.
  • Shrink and eventually remove the margin of the page on smaller screen sizes.
  • Shrink the margin of the content on smaller screen sizes.
  • Stick the style menu to the bottom of the viewport on touch screen and mobile devices.

The popup menu with Heading 1/Heading 2/etc not working

Hello,

I tried 'Local testing' of this plugin as described in https://github.com/jlvandenhout/docusaurus-plugin-docs-editor#local-testing.

In the editor, buttons such as Bold or Bullet list do work, but the popup menu with Normal Text/Heading 1/Heading 2 can only change an existing heading to normal text, but not vice versa: if I select a normal text and click on 'Heading 1', nothing happens. If I click 'Heading 1' on an empty line and then try to type any text, the cursor just disappears and it's impossible to type anithing.

Any hints?

Tested in firefox, chrome and chromium.

Implement GitHub integration

The idea is to create a fork on behalf of the user and use that as a working directory. Whenever the user wants to edit a certain page, the editor will check if there is a fork of the upstream repository, if there is a branch to work on this page and if the path to this page is present, creating any of these when missing. Then if a user is done editing the page may be saved, which results in a commit to the branch, or published, which results in a pull request from the current branch to the upstream repository default branch.

Add linter & formatter

As a would-be contributor, I really hope you can install a linter/formatter like Prettier/ESLint to unify the code style. Things like semicolons, spacing, etc., seem to be inconsistent in the source already, and if this repo accepts contributions without formatting them, this would just lead to unmaintainable code in the future.

I can offer to help, but @jlvandenhout you probably know your own style preferences bestπŸ˜‰

Also, I can help to migrate the plugin to TypeScript; would you like to have one .d.ts file, or is it fine if I change all JS files to TS?

Using editor with GitLab

Hi there, excuse me, can you tell me is that possible to use editor with GitLab, unfortunately in my organization, we don't have direct access to external systems, and we using local gitlab. Does anyone tried to set up editor with local gitlab?
I will be grateful for the answers. Thank you!

Better Editing Experience

Imagine the user clicks "Edit" and the left sidebar expands and turns into an editor. The page content becomes your preview area and updates with the users changes. This allows the user to see exactly what their edits will look like when everything is saved which will prevent unnecessary correction edits.

I also think that markdown is the bread and butter if you will of Docusaurus. With this in mind, I think that this should be the highlight of the editing experience rather than making it a simple WYSIWYG editor. I am thinking something more in line with iA Writer (or even this very GitHub markdown text input) where we focus on writing in markdown but provide familiar toolbar buttons that help users format who may not yet be familiar with markdown syntax. This encourages users to learn markdown as they go without impeding anything they need to do.

I was thinking the editor could look like this.

Rich Text View

docusaurus-editor-rich-text

Markdown View

docusaurus-editor-markdown

Split View

docusaurus-editor-split

The design is more consistent with the rest of Docusaurus. It also has three distinct views that cater to different users. If a user prefers editing in markdown they can.

TypeError: Cannot read properties of undefined (reading 'registerLanguage')

Hello, I tried to add the editor plugin to an existing project (managed by npm) using npm install @jlvandenhout/docusaurus-plugin-docs-editor (yarn add would complain that the project is already managed by npm), then added the plugin to docusaurus.config.js.

After that, npm run build, which worked before adding the plugin, fails with:

[ERROR] Docusaurus server-side rendering could not render static page with path /edit.
TypeError: Cannot read properties of undefined (reading 'registerLanguage')
[WARNING] {"moduleIdentifier":"/home/grg/svn/dpanel/docs/docusaurus/devpanel-docs/node_modules/babel-loader/lib/index.js??ruleSet[1].rul
es[5].use[0]!/home/grg/svn/dpanel/docs/docusaurus/devpanel-docs/node_modules/@jlvandenhout/docusaurus-plugin-docs-editor/lib/theme/Edito
r/index.js","moduleName":"./node_modules/@jlvandenhout/docusaurus-plugin-docs-editor/lib/theme/Editor/index.js","loc":"1:2844-2869","mes
sage":"export 'lowlight' (imported as 'lowlight') was not found in 'lowlight/lib/core' (possible exports: highlight, highlightAuto, list
Languages, registerAlias, registerLanguage)","compilerPath":"client"}
[previous line repeated many times]
...
[ERROR] Unable to build website for locale en.
[ERROR] Error: Failed to compile with errors.

At the same time, npm start (test server) is working, but edit page displays an empty page...

Any hint?

Thanks in advance.

Create Markdown from the edited HTML

TipTap uses HTML directly to render the page content and implement its editor interface, however the source files are in Markdown, so we need a way to convert HTML to Markdown to create a useful pull request. The reMarked.js library might be an option.

Rename Edit Links

Instead of "Open In Editor" and "Open In GitHub", could we instead rename them to "Edit" and "View Source"?

Restyle the submit button

Currently when changes are already submitted, the button changes to a link to the created pull request for review. However, the styling should make clear that it is not an action to submit anymore and just a link to an external site. Also the text could be more clear.

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.