Comments (12)
Markdown works with arbitrary number of difernt inner modes. It should work
out of the box. Can u give me an example script?
/Sent from tablet/
On Nov 3, 2013 6:08 AM, "Gergely Daróczi" [email protected] wrote:
Sorry for such lame question, but I would be interested in defining a base
mode with two inner modes (e.g. markdown is the main mode but we also
find YAML and R code chunks with separate tags). Is it possible? If so,
could you please point my attention to a working demo? Thanks, Gergely—
Reply to this email directly or view it on GitHubhttps://github.com//issues/11
.
from polymode.
Sounds great, thanks!
Please see my firsts baby steps (sorry, I do not speak (e)lisp) here: daroczig@c3a36c3
An example document for testing purposes: https://github.com/Rapporter/rapport/blob/master/inst/templates/Minimal.tpl
This document is basically a markdown
document with a special header in YAML
syntax (between the head
tags) and R
expressions can be defined in the traditional brew
tags.
My problem with my really naive try was to let that document have 2 inner modes, but it seems that only the first one is triggered. I have no idea what kind of syntax is needed to be able to use two inner modes in a document. Any help/hint would be really welcomed.
from polymode.
Ok I started getting it. I have one question. Are markdown code blocks
supported? I mean is there only two inner modes (head and brewer) or
polymode should also support arbitrary mode ...
markdown blocks?
from polymode.
Nope, markdown code blocks are not really important here. So "just" the two inner modes (head and brew) are the top priority.
from polymode.
But do you have plans to provide markdown code blocks in the future? If so, then it would be wise to inherit from existing markdown mode and to add two additional modes, brew and YAML.
from polymode.
One more thing. Isn't .tpl associated with something else? It sounds generic to me. Shall we associate it to a more specific extension, like .rapport?
from polymode.
I have merged your code and modified to use proper classes. It works now but very sadly it often blocks emacs. The reason is markdown mode that decided to reinvent font-lock and bluntly re-fontifies the whole buffer on every change you make.
Please pull and check the basics. Note that I activated rapport on ".rapport" extension.
from polymode.
Seems to work fine, thank you very much! This rocks :)
Thanks,
Gergely
PS: you are right about the tpl
extension (bringing up some fun memories with Pascal). We might want to change that in the future... rapport
extension sounds reasonable indeed.
from polymode.
What emacs do you use? What version of markdown-mode? I have serious problems with it and I even reported it to the author. Do you notice a freeze if you edit Minimal.rapport just before the <!--head?
from polymode.
I'm on Arch Linux with GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.2) of 2013-08-07 on -mnt-storage-buildroots-staging-x86_64-eric
with a slightly outdated version of markdown-mode
(c3f86536a33ae30263cb7dccd049758939e45082
from Wed Feb 22 20:36:14 2012 -0500).
You are right about the freeze issue, but I have not noticed it before trying to edit the file before the <!--head
part, as that line should be the first one in the file anyway. But this seems a bit worrisome indeed :(
from polymode.
Please try a new version. The freeze was polymode bug. It took me a while to figure that out, debugging post-command hooks and font lock is a huge pain :( Now everything is fixed.on polymode side. I also remove markdown ugly fontification hooks for time being, otherwise everything is painfully slow. Wait and see what the maintaner has to say.
Rapport is now the most complex polymode. It includes pretty much every feature of polymode: auto-chunks (like markdown chunks) and two known in advance modes (multi chunk mode). I will add org-mode these days and plan to release polymode to MELPA by the end of the week.
Thanks for all the input and please report any issues.
from polymode.
Awesome, thank you very much! Works really fine here.
from polymode.
Related Issues (20)
- Debugger entered--Lisp error: (void-variable polymode-run-these-before-change-functions-in-other-buffers) HOT 4
- Detecting that I'm in an inner chunk, from a major mode hook HOT 2
- On entering emacs lisp source block, text at top of org file is underlined in yellow/red by flycheck HOT 1
- unable to install manually HOT 2
- Help with a (hopefully) simple polymode?
- Reproducible error: stuck in latex-mode
- Starting polymode with lsp, makes the cursor to jump to the end of buffer HOT 10
- can't find polymode via package-install? HOT 1
- electric-indent-mode
- How to run a function is indirect buffers with the same major mode only?
- Typescript-xml polymode
- Setting mode file local variable to polymode applies itself recursively infinitely until cancelled
- Background Adjustment when Background Unspecified
- polymode creates additional [web] buffer
- Interaction with nix-mode: font-lock broken HOT 4
- Chunks not following automatic Emacs switch to light/dark theme HOT 5
- Polymode, Poly-COMEEGA and COMEEGA (Collaborative Org Mode Enhanced Emacs Generalized Authorship)
- inner mode indentation not works on the first line after head mark
- org-mode links become invisible HOT 3
- Polymode does not work in org-edit-special
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polymode.