Hi !
It’s a language included in CodeMirror so I can (https://codemirror.net/mode/)
You can use my filter to add your language :
function my_custom_languages( $languages ) {
$languages[] = array('slug' => 'julia', mode => 'julia', 'label' => 'Julia') ;
return $languages;
}
add_filters( 'advanced_gutenberg_blocks_code_languages', 'my_custom_languages' );
Tell me if it works
Yes it works fine! However, the editor in Gutenberg has an bug related to the cursor position: https://imgur.com/a/dD26z4n
Take a look where I am writing and the cursor position.
-
This reply was modified 7 years, 4 months ago by
ronisbr.
I had this bug but finally fixed it. But not enough : the issue is with CSS line-height.
I’ve set it to 28px to fit Gutenberg default styles. But ifyou made changes in the theme you should update this value (I’ll try later to see if a inherit should fix the issue everytime)
do you have an editor-styles.css ? If yes you can add :
.CodeMirror pre {
line-height: 24px; // Change the value
}
It changed the format, but I could not find a single value that makes things work, unfortunately.
By the way, I am using the twenty fourteen theme with only one style configuration:
.site-content .entry-header,
.site-content .entry-content,
.site-content .entry-summary,
.site-content .entry-meta,
.page-content {
max-width: 800px;
}
Hi @maximebj,
With your advice I managed to make something very nice and usable now! I added the following code to editor-style.css:
.CodeMirror pre {
line-height: 24px;
margin: 0;
padding: 0 0 0 5px;
border: none;
}
Then I got: https://imgur.com/6vNA2tk which is just wonderful! The best code block / plugin I have ever used! Clean, simple, elegant! Congratulations!
P.S.: The photo is the editor, not the one in the website!
-
This reply was modified 7 years, 4 months ago by
ronisbr.
Nice !
I’ll try to find a value that fit everytime in the future to avoid issues with line-height (if it’s possible).
I’m alos publishing a new release today with a lot of fixes.