Skip to content
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

Include CodeMirror in edit page #13

Merged
merged 6 commits into from
Oct 21, 2019

Conversation

n-peugnet
Copy link
Collaborator

@n-peugnet n-peugnet commented Oct 20, 2019

Hey I started to implement this feature

Left to do:

  • update README with npm prerequisite info and build instructions
  • add CodeMirror views for the other text areas
  • move js sources files to /src/
  • make font-size work

Closes #11

@n-peugnet
Copy link
Collaborator Author

Now that the js source files are being bundled I think that they should be moved outside of the public assets directory.

Where do you think we should move them @vincent-peugnet ? I guess somewhere in
the app dir ? Maybe app/js/ ?

@vincent-peugnet
Copy link
Owner

Maybe not in app/ but even more in parent folder for this kind of materials only used to be bundled once.

For me it's even clearer if there is an /src/ at root that I will easily exclude from releases.

PS : the coffee you gave me this morning was sooooo strong !!! (or maybe I was so exited to merge branchs)

@n-peugnet
Copy link
Collaborator Author

Ok good point. Also src is the standard for js sources.

- add npm prerequisite
- add codemirror through npm
- add webpack trough npm to build the js bundles
- add first codemirror enhenced textarea
@n-peugnet
Copy link
Collaborator Author

Okay. There is still a problem: the font-size setting doesn't work with CodeMirror yet

@vincent-peugnet
Copy link
Owner

Okay. There is still a problem: the font-size setting doesn't work with CodeMirror yet

I knew this would be a problem as CodeMirror seems to be "on top of everything".

This is what I've founded in the manual :

Customized Styling
Up to a certain extent, CodeMirror's look can be changed by modifying style sheet files. The style sheets supplied by modes simply provide the colors for that mode, and can be adapted in a very straightforward way. To style the editor itself, it is possible to alter or override the styles defined in codemirror.css.

Some care must be taken there, since a lot of the rules in this file are necessary to have CodeMirror function properly. Adjusting colors should be safe, of course, and with some care a lot of other things can be changed as well. The CSS classes defined in this file serve the following roles:

CodeMirror
The outer element of the editor. This should be used for the editor width, height, borders and positioning. Can also be used to set styles that should hold for everything inside the editor (such as font and font size), or to set a background. Setting this class' height style to auto will make the editor resize to fit its content (it is recommended to also set the viewportMargin option to Infinity when doing this.

@vincent-peugnet
Copy link
Owner

I also appreciate "Install from sources" addition in the README.md file !!!

@vincent-peugnet
Copy link
Owner

vincent-peugnet commented Oct 21, 2019

Oh, I see a quick thing that can be fixed : auto line break should be used for markdown areas as it's set in MichelFortin's script

In the future it should be an option synchronized with the render's options.

It look's to be possible

@n-peugnet
Copy link
Collaborator Author

Oh, I see a quick thing that can be fixed : auto line break should be used for markdown areas as it's set in MichelFortin's script

I'm not sure what you are talking about. but it's now fully functional and I think you should do the options tweaking yourself to choose exactly what you want.

@vincent-peugnet
Copy link
Owner

Oh, I see a quick thing that can be fixed : auto line break should be used for markdown areas as it's set in MichelFortin's script

I'm not sure what you are talking about. but it's now fully functional and I think you should do the options tweaking yourself to choose exactly what you want.

Okay, I've figured out how to do this :

lineWrapping: true

@vincent-peugnet vincent-peugnet merged commit 26c93a7 into vincent-peugnet:develop Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants