Giter VIP home page Giter VIP logo

kirby-markdown-field's Introduction

Markdown Field for Kirby

Enhanced, extensible Markdown field for Kirby CMS. Now available in version 2!

Features:

  • Sophisticated, but subtle highlighting for Markdown and Kirbytext
  • Context-based format toggling (almost WYSIWYG-like)
  • Smart indentation for wrapping headlines, list items, and blockquotes
  • Keyboard shortcuts for most actions
  • Custom toolbar buttons
  • Custom syntax highlights
  • Option to show whitespace characters
  • Clickable URLs
  • Configurable Markdown syntax (e.g. choose from _italic_ or *italic*)
  • Replaces Kirby’s default Markdown block with one, that also supports syntax-highlighting.
  • Support for touch-based devices and great performance (thanks to CodeMirror 6)

💡 TL;DR: The Markdown field, you all have been waiting for!

Screenshot of the editor field

Overview

This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider ❤️ sponsoring me for securing the continued development of the plugin.

Table of Contents


1. Installation

This version of the plugin requires PHP 8.1 and Kirby 4.0.0 or higher. The recommended way of installing is by using Composer:

$ composer require fabianmichael/kirby-markdown-field

Alternatively, download and copy this repository to /site/plugins/markdown-field

2. Setup

This field can replace any textarea field you have set up and works out of the box with as little config as:

editor:
  label: My markdown editor
  type: markdown

3. Options

3.1. Available options

You have access to the very same options as the textarea field, and a few more:

Option Type Required Default Description
font string false monospace Sets the font family (sans-serif or monospace)
pages Object false see below Sets a custom query for the page selector dialog
size String false small Sets the empty height of the Markdown field

3.2. Font settings

You can choose between monospace (monospace) and sans-serif (sans) font. The monospace font offers a more sophisticated layout with indentation for multiline list elements, headings, and blockquote – things, which would be much harder to implement (and slower to calculate) for a proportional font.

While the sans-serif might be more appealing to non-technical writers at first, the monospace should be the preferred version in most cases.

3.3. Buttons

This field is packing the usual textarea buttons and many more.

headlines can contain the whole range of headings from h1 to h6, and therefore accepts an array of allowed levels (default is h1, h2, h3). Use headlines as key in this case:

buttons:
  headlines: # no dash before the key name
    - h1
    - h2
    - h3
    - h4
    - h5
    - h6

You also have access to additional buttons:

buttons:
  - blockquote
  - hr
  - strikethrough
  - pagelink
  - footnote

If you don't need it, you can hide the toolbar. This will also disable the keyboard shortcuts for all formats.

buttons: false

The full list of available buttons. As you can see, some buttons can also have configuration options. Take the bold button for example. Markdown allows different syntaxes for bold text, i.e. __bold__ and **bold**. The editor’s syntax highlighter will always recognize both, but you can adjust, what the editor will use when you click the toolbar button or by hitting the respective keyboard shortcut.

For the link and pagelink buttons, you can specify whether these should insert markdown or kirbytext markup. By default, this will be determined by the kirbytext option by default but can be overridden on a per-button basis.

All button configuration is optional, you can always use - ul instead of ul: -, if you want to stick to the default settings.

buttons:
  headlines:
    - h1
    - h2
    - h3
    - h4
    - h5
    - h6
  bold: ** # or `__`
  link: null # or `markdown` or `kirbytext`
  pagelink: null # or `markdown` or `kirbytext`
  italic: * # or `_`
  - strikethrough
  - code
  ul: - # or `*`/`+`
  - ol
  link:
    blank: true # Show option for opening link in a new tab.
  - blockquote
  hr: *** # or `---`/`___`
  - strikethrough
  - highlight # textmarker (not supported by Kirby’s default markdown parser.)
  - pagelink
  - file
  - footnote
  - invisibles
  - divider # can be used multiple times

3.4. Keyboard Shortcuts

ℹ️ Keyboard shortcuts are only available for those buttons/heading levels enabled in the toolbar.

Block Formats

Format Mac/iOS Linux/Windows
Heading 1 ⌥⌃1 Alt+Shift+1
Heading 2 ⌥⌃2 Alt+Shift+2
Heading 3 ⌥⌃3 Alt+Shift+3
Heading 4 ⌥⌃4 Alt+Shift+4
Heading 5 ⌥⌃5 Alt+Shift+5
Heading 6 ⌥⌃6 Alt+Shift+6
Quote ⌥⌃q Alt+Shift+q
Bullet List ⌥⌃U Alt+Shift+u
Ordered List ⌥⌃O Alt+Shift+o

Inline Formats

Format Mac/iOS Linux/Windows
Bold ⌘B Ctrl+b
Italic ⌘I Ctrl+i
Link ⌘K Ctrl+k
Strikethrough ⌥⌃D Alt+Shift+d
Code ⌥⌃X Alt+Shift+x
Footnote ⌥⌃F Alt+Shift+f

Other

Format Mac/iOS Linux/Windows
Show Whitespace ⌥⌃I Alt+Shift+i
Open clicked URL in new tab ⌘+Click Ctrl+Click

URLs

  • When you select some text and paste a URL, it will automatically create a link tag and use the current selection as link text.

3.5. Pages

You can limit the options shown in the Pagelink dialog, by setting the pages option with a query (if unset, you'll be able to browse the entire website tree)

pages: kirby.page('my-page').children

You can also set the pages option to an object with other properties from the pages field such as info and text

pages:
  query: kirby.page('my-page').children
  info: "{{ page.tags }}"
  text: "{{ page.title.upper }}"

3.6. Size

You can define the height of the field when empty. The default is two-lines, which mimics the textarea's default empty height.

If you want the field to mimic a text field but with some markdown highlighting on top of it, set the size to one-line and buttons: false.

All predefined sizes are:

- one-line
- two-lines
- small (same as textarea)
- medium (same as textarea)
- large (same as textarea)
- huge (same as textarea)

Note that you can make the default height any height you want with some custom panel CSS. First, set the size option to any string you'd like:

size: custom-size

Then in your panel.css:

.k-markdown-input-wrap[data-size="custom-size"] {
  --cm-min-lines: 20;
}

4. Extension API

The API has changed from version 1, old plugins are not compatible anymore and require a few adjustments. See extension-examples folder.

There are two types of extensions, which allow you to extend the editor to adjust it better to your specific needs:

  • Custom buttons: You can define your own buttons, which can be added to the editor toolbar. Buttons can define keyboard shortcuts, display dropdowns, and even show a popup.
  • Custom extensions: You can define your own editor extensions. An example can be found in the extension-examples/indent-with-tab folder.
  • Custom highlights: You can define regex-based custom highlights, which allow you to highlight any text, such as markup for custom syntax (e.g. global text snippets or Wiki-style links)

4.1 Custom options for pages, files, and uploads

Your extension can use a special endpoint to extend the base options for pages, files, and uploads with parameters set in the button configuration. See an example in the extension-examples/custom-pagelink folder.

// special routes to read options from the button configuration
this.input.endpoints.field + "/myextension/pages"
this.input.endpoints.field + "/myextension/uploads"
this.input.endpoints.field + "/myextension/files"

The end user can configure options for your extension as part of the button configuration:

text:
  type: markdown
  files:
    […]
  pages:
    […]
  buttons:
    myextension:
      pages:
        query: site.index
        info: "{{ page.tags }}"

5. Development

  • Clone the repo
  • cd to your newly created folder (named kirby-markdown-field, or whatever you have chosen)
  • npm install to get all the dependencies
  • Then:
# Dev mode
npm run dev

# Build plugin + autoprefix styles
npm run build

You must run the build process before pushing the repo, or else the hot-reload code will prevent it from working in any install.

7. Migrating from Version 1

  • Setting available headline levels now works a bit differently, see 3.3. Buttons. This was necessary to allow for multiple, configurable dropdowns in the future/extensions.
  • The horizontal-rule button was renamed to hr.
  • The modals option has been removed. Clicking the link button will always display a modal.
  • The link and email buttons have been merged into a single popup.
  • The blank option has been moved from the global options to the link button.
  • The invisibles option has been replaced by a button, called invisibles. Just add that to your toolbar setup instead.
  • The API for registering custom buttons has changed. See extension-examples folder for examples.
  • Font scaling options have been removed. Version 2 of the Markdown field only accepts monospace and sans as font options. if you need scaling of headlines, consider using Kirby’s Blocks field instead.
  • The global field options have been removed. Use field presets instead. (see https://getkirby.com/docs/guide/blueprints/extending-blueprints#reusing-and-extending-single-fields).
  • The direction option has been removed. CodeMirror 6 automatically determines the current text direction of the panel.

8. Known Issues

  • Kirbytags: In some edge cases with nested parenthesis or nested Kirbytags, the highlighting can differ from how Kirby parses the markup. This shouldn’t be an issue for most daily use cases. You can also not have multiple consecutive line breaks within Kirbytags, or the highlighter will fail. This is because of the way Markdown makes a clear separation between block and inline elements.
  • Kirbytags in HTML blocks are not highlighted, because CodeMirror uses its own HTML Parser for that, which deactivates all Markdown highlighting within these. Parsedown Extra supports the markdown="1" attribute on HTML block-level elements, which is not supported by CodeMirror’s Markdown parser.
  • Inline Format toggling: The selection will sometimes behave in unexpected ways when dealing with very complex re-formatting. Solving this would need a more sophisticated selection/caret-tracking during all transformations. IMHO, it still works better than in most other Markdown editors and does not lead to data loss, so ¯\_(ツ)_/¯.

9. What’s not supported (and never will be)

The way Markdown is used nowadays has changed since its inception, especially since GFM ("GitHub-Flavored Markdown") became popular and added some elements to the language.

  • Setext-style headings: If you don’t know what these are, just forget about them. There is basic highlighting, but they are neither recognized as headings by the toolbar nor respected when changing formats. Use ATX-style headings instead (e.g. ## Heading Level 2).
  • Indended code blocks: Use fenced code blocks instead.

10. License

MIT (but you are highly encouraged to ❤️ sponsor me if this piece of software helps you to pay your bills).

11. Credits

Text editor:

Contributors:

@fabianmichael, @sylvainjule, @medienbaecker, @mtsknn, @nsteiner, @rasteiner, @thomasfahrland, @johannschopplich

Inspired by:

kirby-markdown-field's People

Contributors

dependabot[bot] avatar fabianmichael avatar johannschopplich avatar luxuryluke avatar medienbaecker avatar mtsknn avatar nilshoerrmann avatar onezerodigits avatar rasteiner avatar s3ththompson avatar sylvainjule avatar thomasfahrland avatar tobimori 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kirby-markdown-field's Issues

Toolbar Button for special characters

I am often using special whitespace characters for controlling text layout. In most cases, these are:

  • No-break space
  • Soft hyphen
  • Thin space

Maybe we should add an optional menu (just like for headline level) for inserting any of these characters and maybe some other, common special chars as well? This will especially help Windows users, who do not have convenient access for chars like the no-break space.

Add toolbar and basic shortcuts

Start by adding the exact same as the textarea field:

1. Toolbar

  • headlines
    • H1
    • H2
    • H3
  • bold
  • italic
  • link
  • email
  • code
  • ul
  • ol

2. Shortcuts

  • Bold (Cmd + b)
  • Italic (Cmd + i)
  • Link (Cmd + l)
  • Email (Cmd + e)

Make sure all options are working

I leave buttons out of this list, while we're figuring out how to handle them.

  • autofocus
  • counter
  • default
  • disabled
  • help
  • icon
  • label
  • maxlength
  • minlength
  • placeholder
  • required
  • size
  • translate
  • width

Toggle formatting

Triggering a format action on an already formatted text should toggle the formatting.

bold2

Composer installation throws an error: not found

I'm not able to install it with composer.

I tried it with: composer require community/markdown-field but I get this error:

[InvalidArgumentException]                                                                                                                                                                                                
  Could not find a matching version of package community/markdown-field. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (beta). 

Add "render invisibles/whitespace" option

Implement the possibility of making whitespace visible in the editor (basically what every IDE or code editor offers). This also includes line-breaks in Markdown created by adding 2 spaces at the end of a line.

Later on, we can add a button to the toolbar to toggle this feature.

Registration of custom buttons

It would be great to be able to easily add custom buttons. The current issue is the order in which components are loaded.

Currently, each button (eg. bold) will look for a corresponding k-mardown-button-bold component, which contains a bunch of things:

  • Its template (which only the headlines button overrides)
  • Some data:
data() {
  return {
    label: 'My label', // Shown on hover
    icon: 'my-icon', // Displayed in the toolbar
    type: 'my-button-type', // Used to identify whether the current selection is within the associated token type
    shortcut: 'Cmd-B', // Shortcut that should trigger the action (optional)
  }
}
  • An action method, triggered on click or shortcut:
methods: {
  action() {
    alert('It works!')
  }
}

All buttons extend a base button (button.vue).

So, in theory, one could create custom buttons by registering a component in another plugin, with as little config as:

panel.plugin('my/methods', {
  components: {
    'k-markdown-button-test': {
      extends: 'k-markdown-button',
      data: function() {
        return {
          label: 'My label',
          icon: 'my-icon',
        }
      },
      methods: {
        action() {
          alert('It works!')
        }
      }
    },
  },
});

And then in a blueprint:

mymarkdownfield:
  type: markdown
  buttons:
    - test

The issue is: how could we set it up so that k-markdown-button is available to extend by the time k-markdown-button-test tries to?

Type text and markdown throws error in same blueprint

The error The field type "text" does not exist is thrown when using type: text and type: markdown on the same blueprint. Can you reproduce?

The following blueprint won't work:

preset: page
pages: false

fields:
  intro:
    label: Intro
    type: text

  text:
    label: Text
    type: markdown

Overwritable default buttons

The old SimpleMDE field had this too and I found it pretty useful. In the site/config.php you could define:

'community.markdown-field.buttons' => ['headlines', 'bold', 'italic']

I already started with it, but I think we need to change the array_merge_recursive() function in lib/fields/markdown.php as it doesn't allow overwriting existing props. If I understand it correctly it only adds another buttons to the props array. See https://medium.com/@kcmueller/php-merging-two-multi-dimensional-arrays-overwriting-existing-values-8648d2a7ea4f

After that we should be able to just add something like this to the lib/fields/markdown.php file:

'buttons' => function() {
  return option('community.markdown-field.buttons');
}

...and this to the /config.php file:

'options' => array(
  'buttons' => ['headlines', 'bold', 'italic', 'divider', 'link', 'email', 'code', 'divider', 'ul', 'ol']
)

[Bug] 'Image' and 'File' Buttons Fail on Top Level of Panel

The image and file buttons work fine inside a Page - e.g., the Home Page. But if the field is placed somewhere at the top level of the panel - ie., when the field is being used inside the 'site.yml' blueprint - then these buttons don't work, and the user gets an error message:

screen shot 2019-01-12 at 11 28 12 am

I guess the queries that are being used are page.images and page.files. When we're trying to get images and files at the top-level, outside any pages, I guess they have to be site.images and site.files.

Toolbar loses its stickiness in Safari

When a blueprint has type: textarea, the toolbar’s stickiness behaves correctly (i.e. it remains stuck to the top of the viewport when text area has focus and as you scroll up and down). Yet upon setting type: markdown, this behaviour is broken, with the toolbar remaining fixed in position as you scroll. This is only the case in Safari†, in other browsers (Firefox and Chrome) everything works as expected.

† Safari Technology Preview Release 72 (Safari 12.1, WebKit 14607.1.17.1) and Safari 12.0.2

Fine-tune headlines option

Allow dev to either register the whole headlines dropdown:

buttons:
  - headlines

Or limit the displayed headlines (would still be grouped under the headlines dropdown):

buttons:
  - headlines
    - h2
    - h3

Fine-tune code wrapping

If single-line: wrap it with 1 backtick (current behaviour)

If multiline (code block): wrap it with 3 backticks.

Automatic detection for link / email modals

Currently, any text selected before clicking the button will fill the text field of the modal.

We should add some automatic detection in case the selected string is an url / email, and fill the link / email field of the modal instead.

Kirby translations return nothing with activated plugin

Using:

  • Kirby 3.0 RC3
  • this plugin in latest version
  • no other plugins

In a setup using two languages (de & en) the t() helper returns nothing at all across different pages.

For example use the following language file with t('t.test'):

<?php

return [
  'code' => 'de',
  'default' => true,
  'direction' => 'ltr',
  'locale' => 'de_DE.utf8',
  'name' => 'Deutsch',
  'url' => '/',

  'translations' => [
    't.test' => '&larr; Hi',
  ]
];

[Feature Request] 'Query' Option for Images

The query option that we have for pagelink could also be useful for the image picker. Here is the use-case: I am building a one-pager, where each of the page's sections is a child page. Each one of these child pages will use the markdown field, and all of them will need to embed images into the field.

However, as they are all really part of the same parent page, rather than having to add a Files Section on each child page, allowing the user to upload images into each individual child page, I'd rather just add a single Files Section in the parent page. Ideally, the user would be able to then pick the images from the parent page - not from the current one.

This would be important also in avoiding multiple uploads of the same image, that are being used in different sections of the same page.

That is, of course, just one use-case, and I'm sure there will be others.

Error if I choose no picture, but confirm

An error accours, if i click on image button in editor, select no image but confirm with okay.

screencast 2019-01-24 07-50-53

kirby-markdown-field: latest(f62b775), but also in other older versions
Kirby 3.0.0
Max OSX, Chrome latest 70.x

[CSS] Some font-sizing / styling questions

1. Decrease monospace font-size?

Shouldn't we decrease a little the monospace font-size (font-size: $font-size-small), so that it keeps the vertical rythm of the textarea field? It currently feels a bit big.
With the change:

capture d ecran 2018-12-30 a 17 30 18

capture d ecran 2018-12-30 a 17 31 23

2. Sans-serif headlines

Currently, h6 ends up being 14px while a regular paragraph is 16px.
Shouldn't we adjust those proportions so that h6 = paragraph?

3. Font-styling options

Should we give devs the possibility to disable the scaling of headings when displaying sans-serif?

Options could become:

font:
  family: sans-serif
  scaling: false

Long content glitch

Sometimes when I paste long content with a lot of formatting the upper half gets hidden. When triggering a rewrite via a click or browser resize, it gets fixed. Tested in latest Chrome, Firefox and Safari.

I have not yet found the exact length or formatting amount to reproduce it. You can find an example text on the bottom of this issue, though.

markdown

## Lorem Ipsum 

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.aaa

**Lorem Ipsum:**

- 2009: Finalistin beim internationalen Wettbewerb „Schömberger Fotoherbst für Reise- und Reportagefotografie“ mit ihrer Dokumentation der Arbeit der „Helfenden Hände e.V.“ in Nouakchott / Mauretanien. 
- Im September 2009 erstmalige Teilnahme an den IPA int ́l photography awards in New York; Ulrike Klumpps Arbeiten erreichten die Endrunde und damit ein „Honorable Mention“. 
- Diesen Erfolg konnte sie in den Folgejahren 2010 – 2015 wiederholen.
- Im Juli 2010 war ihr Projekt “SchwarzwaldMenschen” eines der vier Besten des Berliner Wettbewerbs “Halbtagsjob 2010”.
- 2011: Finalistin beim 11. „Schömberger Fotoherbst “ mit der Geschichte „Farm Glenorkie“.
- September 2011: 2. Platz der IPA New York, Kategorie Architektur / Stadtlandschaften.
- 2015: Finalistin beim 13. „Schömberger Fotoherbst“, Serie „Waisenhaus in Burundi“.

**Lorem Ipsum:**

- Ausstellung „Naturreine Interpretationen“ in der Kreissparkasse Freudenstadt, August 2007.
- Ausstellung „Anders sehen – anderes Sehen“ in Dornstetten, Frühjahr 2009. Die Serie entstand aus der ehrenamtlichen Dokumentation der Arbeit der „Helfenden Hände e.V.“ in Nouakchott/Mauretanien.
- Gruppenausstellung „Farbe in der Natur“ im Palmengarten Frankfurt, Oktober 2009.
- Teilnahme an der Internationalen Kalenderschau des Graphischen Klubs Stuttgart und am Calendar Fair der Japan Federation of Printing Industries mit einer Auftragsarbeit für die HOMAG Holzbearbeitungssysteme AG. Januar 2010.
- Ausstellung „ 7969 km Schwarzwald – Namibia“ in der Kulturfabrik in Schopfheim, 2012/13.
- Im Oktober 2013 eröffnete Ulrike Klumpp ihre eigene Fotogalerie in Baiersbronn. Neben ihren eigenen Fotoprojekten bietet die Galerie auch Raum, Ausstellungen anderer Fotokünstler zu präsentieren.
- Gemeinschaftsausstellung „Heimischer Hirsch“ – Kunstausstellung mit zeitgenössischer Malerei und Fotografie, Galerie U in Baiersbronn, ab April 2015.
- Ausstellung „Kaffee – Menschen – Kunst“ über das Kaffeeland Guatemala im Neuen Rathaus Altensteig, Juli – September 2016.
- Ausstellung „ Naturreine Interpretationen“ in Berlin Sommer 2017 zur IGA 2017
- Ausstellung „Olifant“ im Rathaus Freudenstadt Sommer/Herbst 2017
- Ausstellung WÄLDER im Haus des Waldes in Stuttgart
- Ausstellung Menschen in Burundi in Berlin 2018-12-13

**Lorem Ipsum**

Buch „WÄLDER in Baden Württemberg“ zusammen mit Forst BW 2017
Silberburg Verlag, Tübingen ISBN 978-3-8425-2038-7

[Bug] Unable to Override 'buttons' Option from Field Blueprint

Let's say I define a 'default_markdown.yml' field blueprint, which sets out all the buttons I normally want in my standard markdown fields - it looks something like this:

buttons: 
  - headlines
    - h2
    - h3
    - h4
  - bold
  - italic
  - strikethrough
  - horizontal-rule
  - ul
  - ol
  - blockquote
  - code
  - image 
  - file 
  - pagelink
  - link
  - email

Now, somewhere else in my site, I'm going to extend this blueprint, wanting to override the 'buttons' option, because I want to use less buttons. So, I'd do something like this:

byline:
  extends: fields/default_markdown
  buttons:
    - bold
    - italic
    - link
    - pagelink
    - email

Unfortunately, when I do this, I still get all the buttons from the original field blueprint - not the overridden, shorter list...

Fix incrementation when adding a new ordered li

Currently, when cursor is right after an ordered li, on click on the ordered-list button the current incrementation isn't taken into account and always insert 1. .

screen recording 2018-12-31 at 12 52 pm

While this will not cause any issue when rendered, this can be confusing for editors.

Cursor position resets editor on saving

When hitting CMD+S while editing, the cursor will jump back to the beginning of the editor field. It should stay where it was before and ideally also keep the current selection if there is one.

Initial numbering of numbered lists

I noticed that new lines in numbered lists now automatically increment the number.
That may not be required in terms of functionality, but it's definitely nice to have.

When formatting lines of text to a numbered list, it doesn't do the same, though:

numlist

Long HTML tags explode writing area width

I am using the pages preset with the bigger one (⅔ ratio) using a type: markdown field. No custom plugin configuration. I guess there's nothing else to say. 🙂

grafik

Hide markdown.

Can the markdown characters be hidden to make this a bit more non-developer friendly? My clients would certainly be confused why "##" appears before the text once they choose to make it a heading.

fatal error if kirby is installed in a custom directory

If you install Kirby in a custom directory (https://getkirby.com/docs/cookbook/installation/composer#installing-kirby-to-a-custom-directory), the plugin throws this error:
Warning: require(/var/www/htdocs/vendor/k-community/markdown-field/lib/fields/../../../../../kirby/config/fields/textarea.php): failed to open stream: No such file or directory in /var/www/htdocs/vendor/k-community/markdown-field/lib/fields/markdown.php on line 5

The path is falsely defined hard:
https://github.com/sylvainjule/kirby-markdown-field/blob/fe3d9df124668297422a9247d45fca8c308872c4/lib/fields/markdown.php#L5

Prepare autocomplete API for editor

Make CodeMirror aware of Kirbytags and implement an basic autocomplete feature, that will allow us to define simple rulesets for all built-in Kirbytags. This should be made available for user-generated Kirbytags later on.

Disable buttons when cursor is inside a kirbytag

When the cursor / current selection is inside a kirbytag, I'd disable all the kirbytag-inserting buttons (link, email, pagelink, image, file), because as far as I know you can't nest them.

What do you think?

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.