4 ms·
This article was very inspirational for me when developing the CMS for a previous startup and informed that development extensively. Personally, I found the mo
by morgante 11y ago
This article was very inspirational for me when developing the CMS for a previous startup and informed that development extensively.
Personally, I found the most beneficial thing to be abandoning HTML entirely. Instead I developed a JSON data structure for documents which was stored internally. This is very powerful for a couple of reasons:
1. Any user input can be mapped as pure functions on top of your internal document structure. This way you can also enforce business rules easily. Additionally, any function which you don't support will never occur. (No more Word garbage!) ContentEditable works fine as an input though.
2. You can write functionally pure mappings from your internal structure to other formats. This of course includes HTML, but isn't exclusive to HTML. Content can also be mapped into native mobile components as well.
3. You can be flexible with input types. For example, it was fairly trivial to (for fun) add a Markdown mode which would map any Markdown input onto the internal document representation and then back to Markdown.
4. You can introduce new semantic concepts which HTML doesn't have elements for, like a "quiz." This makes it easy to rejigger the display of such elements later on, or to have the same semantic element render completely differently on mobile and desktop (for example). With HTML, you're stuck doing error-prone tree parsing or Regexes.
- degenerate 11y agoWere you able to handle paste-from-word? If so, would you mind sharing that bit of code on github? I would love to make a custom solution, but 90% of the content being put into our CMS is copied from Word. To clean it effectively, I resort to using CKEditor to clean it for me and then storing as HTML. I'd love to not do that, but CKEditor seems to have figured out all the problems, especially when pasting tables or adjacently aligned content. My users won't learn markdown and expect it to just "work". For complex Word documents, I never came up with a viable solution to parse it.
- morgante 11y agoYes, we were able to handle pasting from Word. We basically gathered a ton of examples of the HTML which Word generates and then developed mappings from that HTML to the actions we supported. TDD and unit testing made it fairly efficient. Keep in mind that we purposefully did not support the full scope of HTML which Word would output. Authors couldn't make their headlines 50pt Comic Sans in red, for example. I'd love to share the code, but unfortunately it's from an old employer and I no longer have access (or the right to share the code).
- btown 11y agoAtlassian does something similar for Confluence, for presumably the same reasons. https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html https://confluence.atlassian.com/doc/confluence-storage-form...
- chm 11y agoI'm interested in what kinds of pressures made you consider developing an in-house CMS the best option? When does one make that choice?
- morgante 11y agoWe were a media company so our CMS was our core technology. We wanted to do some interesting things with built-in analytics and automatic a/b testing which would have required extensive plugins and modifications to WordPress (our primary alternative). It also seemed unlikely that we would be able to find very many good developers (the kind we'd need to build some of the analytics technologies we were considering) who were enthusiastic about developing on WordPress. In retrospect, it was probably the wrong call. While we made created some unique products and technology that I'm still proud of, it was challenging to get writers on board with some of the newer things (like automatic A/B testing of headlines). It was very expensive to build and maintain a technology team and ultimately without editorial buy-in the returns just weren't there (though our marketer loved it). My last move before leaving the startup was to transition everything to WordPress.
- chm 11y agoSo you did this work for basically nothing?