Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank line should not be required after closing backticks #59

Closed
Nek opened this issue Nov 10, 2013 · 10 comments
Closed

Blank line should not be required after closing backticks #59

Nek opened this issue Nov 10, 2013 · 10 comments

Comments

@Nek
Copy link

Nek commented Nov 10, 2013

![screen shot 2013-11-11 at 01 45 05](https://f.cloud.github.com/assets/132011/1509172/5296c198-4a38-11e3-8534-ab1acc1cb220.png)

Am I doing it wrong?
@greghendershott
Copy link
Owner

Frog uses Pygments to syntax highlight. It looks like Pygments uses either clj or clojure to name the lexer for Clojure.

Are you trying something like the following markdown?

```clj
(ns foo.core
  (:require foo.util))

(defn -main
  [& args]
  (doseq [name args]
    (foo.util/greet name)))
```

On GitHub (which also uses Pygments) that results in:

(ns foo.core
  (:require foo.util))

(defn -main
  [& args]
  (doseq [name args]
    (foo.util/greet name)))

That also worked for me when I tried an example blog post in Frog.

Do you:

  1. Have Pygments installed?
  2. Have a css/pygments.css file to control the syntax colors?

@Nek
Copy link
Author

Nek commented Nov 10, 2013

I do have pygments installed (version 1.6) and the pigments.css is there in the folder.
Actually I made sure pygments worked well before posting the issue.
Also the engine successfully generates highlighting for the code from the example file.

I've spent some time trying to narrow down the problem. It has nothing to do with the clojure and it looks like a bug in the engine. I've made several gists to demonstrate the problem.
Trying to render any of them using the frog will give you the bug:
https://gist.github.com/Nek/7403447

There are some tricks to get everything rendered well though:
https://gist.github.com/Nek/7403583

@greghendershott
Copy link
Owner

OK, I see. I'll take a look at my markdown grammar. It sounds like my grammar is requiring a blank line after the line with the closing backticks. I had thought that was correct. However it looks like a blank line is not required by GitHub nor by most implementations covered by BabelMark. Thank you for pointing this out.

Also I'll update the title of this issue.

@greghendershott
Copy link
Owner

No, actually my grammar already is not requiring a blank line after the closing backticks for a fenced code block. I just added unit tests for some of your exact examples, and they're passing. For example following passes:

  (check-md @~a{```
                yo
                ```
                ```
                yo
                ```
                ABC
                }
            '((pre () "yo") (pre () "yo") "ABC"))

However I did a big update to the markdown parser, just a couple days ago. I should make sure you have the latest version.

If you're using Racket package manager

Please do

raco pkg update frog

Did it update anything? If so, please try again. Is the problem still happening?

If you're building from Git

Please pull the latest for all of the following repos: frog, markdown, parsack. Then try again, and let me know please?

@Nek
Copy link
Author

Nek commented Nov 11, 2013

I use raco.
I'm not sure about it updating anything so here's the log:

> raco pkg update frog Updating: (#<pkg-desc>) Removing frog raco setup: version: 5.3.6 [3m] raco setup: variants: 3m raco setup: main collects: /Applications/Racket v5.3.6/collects raco setup: collects paths: raco setup: /Users/Nek/Library/Racket/5.3.6/collects raco setup: /Applications/Racket v5.3.6/collects raco setup: --- pre-installing collections --- raco setup: --- compiling collections --- raco setup: making: racket raco setup: --- parallel build using 4 processes --- raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/_src raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/_src/posts raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/_src/subdir raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/css raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/fonts raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/img raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/js raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/frog raco setup: 2 making: scribblings/main/user raco setup: --- updating info-domain tables --- raco setup: --- creating launchers --- raco setup: --- building documentation --- raco setup: --- installing collections --- raco setup: --- post-installing collections ---

I still have the problem after doing the update.
I'm on OS X 10.9 btw.

I'll try to build it from git and report the result here.

@greghendershott
Copy link
Owner

When I said to try raco pkg update frog I expected it would transitively update the markdown package used by frog, as well as install a package parsack newly used by markdown. From the output I'm not sure that actually happened.

How about this instead:

$ raco pkg install parsack
$ raco pkg update markdown

I think that should do it.

If not, would you mind running raco pkg show, and copying the output here for me to look at?


Although you could also build from git if you wish, you'll need to git clone and raco link a number of repos (rackjure, parsack, markdown, find-from-dir, frog). You shouldn't have to do all that, just to get the newer markdown parser.

Again, the key point is to update the markdown parser, which in turn needs a new package called parsack.

If you were installing frog from scratch it would work (I know from Travis CI testing). It's the update scenario I'm not 100% sure about, using the new Racket package manager.

@samth
Copy link
Sponsor

samth commented Nov 11, 2013

You probably need the --update-deps (or a related flag like --auto) as an argument to update. See http://www.cs.utah.edu/plt/snapshots/current/doc/pkg/cmdline.html?q=update#%28part._raco-pkg-update%29

@greghendershott
Copy link
Owner

Thanks @samth. So @Nek I think you want to try:

$ raco pkg update --update-deps frog

Or probably this would also work:

$ raco pkg update --all

I'm sorry for the confusion. The Racket package manager is still fairly new. I guess I need more experience with it, especially as a package user as opposed to a package developer.

If things still aren't working, please do

$ raco pkg show

and paste the output here if you don't mind. That will show a checksum for each package, which may help me understand.

@Nek
Copy link
Author

Nek commented Nov 11, 2013

The problem solved! Thanks a lot for paying all the attention.

My frog was outdated (0.7) but

raco pkg update frog

didn't work.

Looks like

$ raco pkg update --update-deps frog

didn't work too but

$ raco pkg update --all

fixed it for me!

Here is the log:

> raco pkg update --update-deps frog
raco pkg update: could not remove package
 package not currently installed
  current scope: user
  package: (markdown 0.5)
  currently installed:
   base
   frog
   parsack
   rackjure
   markdown
   find-parent-dir
[00:31:38] Nek@lambda /Users/Nek/Projects/Racket (1)                                                              
> raco pkg update --all
Updating: (#<pkg-desc> #<pkg-desc>)
Removing frog
Removing markdown
raco setup: version: 5.3.6 [3m]
raco setup: variants: 3m
raco setup: main collects: /Applications/Racket v5.3.6/collects
raco setup: collects paths: 
raco setup:   /Users/Nek/Library/Racket/5.3.6/collects
raco setup:   /Applications/Racket v5.3.6/collects
raco setup: --- pre-installing collections ---
raco setup: --- compiling collections ---
raco setup: making: racket
raco setup: --- parallel build using 4 processes ---
raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example
raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/_src
raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/_src/posts
raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/_src/subdir
raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/css
raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/fonts
raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/img
raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/example/js
raco setup: 3 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/frog/frog
raco setup: 2 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/markdown/markdown
raco setup: 1 making: scribblings/main/user
raco setup: 2 making: /Users/Nek/Library/Racket/5.3.6/pkgs/installed/markdown/markdown/test
raco setup: --- updating info-domain tables ---
raco setup: --- creating launchers ---
raco setup: --- building documentation ---
raco setup: --- installing collections ---
raco setup: --- post-installing collections ---

@greghendershott
Copy link
Owner

Great, I'm glad it's working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants