gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit3dc27d783dc27d78mail-demo: format Style with nested rules and bare mediamre3dc27d78/components/showcase/md-editor.hl

2.5 KB

  1. // components/showcase/md-editor.hl — `/components/md-editor`: the Markdown editor, themed (the component is the verbatim copy
  2. // in components/md-editor/, the theme's rules in theme/theme.hl section 3 take its frames away). The showcase keeps no
  3. // files: its mdUpload face answers an address under /not-kept/ (the editor shows the link, the file is gone).
  4. parent '../main.hl'
  5. import SiteHeader from '../site-header.hl'
  6. import SiteSidebar from '../site-sidebar.hl'
  7. import ContentFirst from '../../theme/shell/content-first.hl'
  8. import TheMdEditor from '../md-editor/md-editor.hl'
  9. __title = 'Markdown editor · WorldAPI layouts'
  10. static NL = "
  11. "
  12. String note = '# Reading list' + NL + NL + 'Books for the **autumn**, with *one* `code` word and a [link](https://worldapi.org).' + NL + NL + '- The Left Hand of Darkness' + NL + '- Piranesi' + NL + NL + '| Book | Year |' + NL + '| --- | --- |' + NL + '| Piranesi | 2020 |' + NL + '| The Left Hand of Darkness | 1969 |'
  13. View {
  14. showMdEditor {
  15. SiteHeader { current = "/components/md-editor" }
  16. ContentFirst {
  17. SiteSidebar { current = "/components/md-editor" }
  18. main {
  19. h1 { "Markdown editor" }
  20. p { class = "muted" "Edit visually: headings look like headings, bold is bold. One sunken surface; the toolbar is a strip on it, no lines between the parts." }
  21. form { method = "get" action = "/components/md-editor"
  22. TheMdEditor { name = "note" value = note }
  23. h2 { "An empty one" }
  24. TheMdEditor { name = "summary" placeholder = "An empty one: type here…" }
  25. }
  26. h2 { "One row, no File button" }
  27. p { class = "muted" "rows = 1 makes the surface one line high (it grows with the text), files = \"off\" takes the File button away: pasted or dropped files are left to the page (the comments block uses this inside its attach form)." }
  28. form { method = "get" action = "/components/md-editor"
  29. TheMdEditor { name = "line" rows = 1 files = "off" placeholder = "One line, no files…" }
  30. }
  31. h2 { "Read only" }
  32. p { class = "muted" "readonly = \"true\": the Markdown shown formatted and nothing else — no toolbar, no field. The comments block draws its texts so." }
  33. TheMdEditor { name = "shown" value = note readonly = "true" }
  34. p { class = "readme links" a { href = "/read/readme-md-editor" "README of the component (how an app uses it)" } }
  35. }
  36. }
  37. }
  38. }
  39. // files dropped into the editor: a showcase keeps nothing, every file gets an address that leads nowhere
  40. on server mdUpload(files) {
  41. urls = []
  42. for (f of files) { urls.push('/not-kept/' + f.size) }
  43. return urls
  44. }

Branches

Latest commits

  • 3dc27d78mail-demo: format Style with nested rules and bare mediamre
  • cf9648afhome: format Style with nested rules and bare mediamre
  • 846a6242user-menu: format Style with nested rules and bare mediamre
  • 4d58708cthree-pane: format Style with nested rules and bare mediamre
  • 0bbfc553main-menu: format Style with nested rules and bare mediamre
  • 7755199dlist-first: format Style with nested rules and bare mediamre
  • 35199303content-first: format Style with nested rules and bare mediamre
  • 00f6e698app-sidebar: format Style with nested rules and bare mediamre
  • bb2f29c9app-header: format Style with nested rules and bare mediamre
  • 3aca2d7fSync components from 8176eb1 with reviewed nested stylesmre
  • 87e4003dRe-vendor layouts to Hybriel set day35mre
  • d8628cfflayouts: a startup error prints its message before exit 1 (hybriel#247)mre
  • 180fd76elayouts: MdEditor from components 59704ce (text on the clipboard always pastes, a file manager copy still attaches; pipe rows; empty Table-button table; tickets#49, notes#5)mre
  • a3eda8afRe-vendor Hybriel master 7a684920 (binary 74ab3715): plugins whole, startup fault exits 1; files-upload gate 340/0mre
  • 025d5880WIP re-vendor Hybriel set-day27b (a9712e61, master f5ff97bf): plugins whole, startup fault exits 1; NOT deployable: files-upload emit refused (see .scratch/rv27-upload)mre
  • 42183a71Merge sb3-standby: layouts deploys through its standbymre
  • 408de1f2layouts: no jobs switch needed in the standbymre
  • 0b85f57elayouts: a standby container (port 45019, profile standby); deploy hands over through standby-swap.sh without a gapmre
  • 31e40b8bMerge dm3-media: range handling in the layouts media routemre
  • 856dcacbLayouts media route: read suffix ranges and ignore range lists and garbage, like the components route (the layouts copy still answered 416 for the last bytes)mre