[TxMt] Re: Regex For Markdown Fenced Code Blocks

Robert J. Rockefeller bob at bobrockefeller.com
Tue Feb 10 16:40:56 UTC 2015


I still have something wrong.

My injected grammar (injection selector is L:text.html.markdown) looks like this:

{	patterns = (
		{	name = 'source.yaml.front-matter';
			begin = '\A-{3}';
			end = '-{3}';
			patterns = ( { include = 'source.yaml'; } );
		},
		{	name = 'text.html.markdown.classes';
			begin = '{';
			end = '}';
		},
		{	name = 'markup.raw.inline.markdown';
			begin = ' `';
			end = '`(?=[ .,;-=+])';
		},
		{	name = 'markup.raw.block.markdown';
			begin = '^`{3}';
			end = '^`{3}';
		},
	);
}

My Markdown text block is this:

There are a wide variety of Vagrant Boxes available on [Vagrant Cloud](https://vagrantcloud.com/boxes/search); you can search there for whatever features you need in a Vagrant Box. I found that [Scotch Box](https://github.com/scotch-io/scotch-box) works great for me because it is pre-provisioned (all the pieces are already downloaded as part of the box) and includes a full LAMP (Linux, Apache, MySQL, PHP) stack. We don't need the MySQL part for Grav, but it's there. The [Scotch Box Documention](https://box.scotch.io) provides plenty of information to get it running (just scroll their web page down).

After getting all that done, my project folder for Grav is shown on the right. My Vagrantfile is:
```
Vagrant.configure("2") do |config|

  config.vm.box = "scotch/box"
  config.vm.network "private_network", ip: "192.168.33.10"
  config.vm.hostname = "scotchbox"
  config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

end
```

When I'm ready to work, I open iTerm2 to `grav/public` and type `vagrant up`, wait a bit for Vagrant to do its thing and report that it's done, send my browser to `http://192.168.33.10`, and go to town.

My use of Vagrant is at the low end of the complexity spectrum. There is so much more that Vagrant can do and I'm still moving slowly towards more advanced uses such as sharing the server across the local network so that other devices (my iPad and iPhone) can access the server. Or even sharing it across the Internet so that other people can see what I'm working on.


The name = 'markup.raw.block.markdown’; pattern finds the first ``` but misses the second ``` and runs to the end of the document.

Bob
-------------------
Robert J. Rockefeller
Richmond Hill, GA
www.bobrockefeller.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20150210/37624d32/attachment.html>


More information about the textmate mailing list