phyllisstein / Pandown

A powerful, versatile, highly Subliminal Pandoc build wrapper for ST2/3
64 stars 12 forks source link

Issue with ATX headers #12

Closed mclearc closed 10 years ago

mclearc commented 10 years ago

When I set the preference to force ATX headers to 'true' and then build in markdown the build process seems to clip all the headers off so that there are no ATX headers at all. The text of the header is still there, so that if I wanted to see ##H2 all I get post-build is H2. Is this a bug?

phyllisstein commented 10 years ago

It's almost always a bug! I'll do some more testing in this case and get back to you, but for now, does it work if you format your headers with a space? E.g., ## H2?

mclearc commented 10 years ago

Unfortunately it doesn't. I've tried both ways. If any experimenting seem to suggest something specific I'll let you know. Thanks for a great plugin though!

phyllisstein commented 10 years ago

Hah, thanks, though I think we can call it just okay till this gets worked out. I'm just about back at my computer to delve into it, but could you try invoking Pandoc manually to see if that helps? If you want the exact command, you can get Pandown to echo it to the console by adding "PANDOWN_DEBUG": true to your configuration.

Sent from my iPhone

On Feb 20, 2014, at 11:12 PM, Colin McLear notifications@github.com wrote:

Unfortunately it doesn't. I've tried both ways. If any experimenting seem to suggest something specific I'll let you know. Thanks for a great plugin though!

— Reply to this email directly or view it on GitHub.

mclearc commented 10 years ago

Pandoc on the command line with --atx works as expected. Not sure about the "PANDOC_DEBUG" option. Would I put that in the setting file? I tried it and got thrown an error in the console. It told me to ask for pandoc for --help.

phyllisstein commented 10 years ago

Yup, you would add the debug flag to your user settings file---but it should be PANDOWN rather than PANDOC, so it'd look (kinda) like this:

{
    "PANDOWN_DEBUG": true,
    "includes_paths": ["~/.pandoc/includes"],
    "pandoc_arguments":
    {
        "command_arguments":
        {
            "standalone": false,
        // etc...

The Pandoc argument is actually --atx-headers; it might be throwing away --atx because it doesn't recognize it. However, when I tested, both on the command line and through Pandown, with Atx headers with no space, it still worked fine. Would you be willing to paste in your complete settings file? If you'd rather e-mail it, you can find me at d at daniel dot sh.

mclearc commented 10 years ago

Sorry - my mistake. I used '--atx' on CLI independent of Sublime Text and it gave me the output I expected. So there is something weird that happens when changing 'atx-headers' in the settings to 'true'. Anyway, settings are below.

{ // By default, Pandoc is installed in /usr/local/bin. // If this is different on your setup, modify this setting. "install_path": "/usr/local/bin",

// In order to produce PDF output, Pandoc needs to know where your
// pdfLaTeX lives. Change according to your setup.
"texbin_path": "/usr/texbin",

// Pandoc apparently doesn't search for values for its --include
// arguments anywhere but the working directory, which makes
// working from a standard stylesheet or standard script
// sort of tedious. Set a list of paths here if you'd like the plugin
// to always check for these somewhere else. If this is set, the plugin
// will prefer a file in the working directory, then in the first path
// provided, then in the second, and so on; if it cannot find a file,
// it will pass the raw setting to Pandoc. (So it's still safe to specify
// absolute paths.)
"includes_paths":
[
],

// Should the output file always be opened in its native application,
// regardless of whether Build-->Run is invoked?
"always_open": false,

// Should the output file be loaded in a new Sublime column?
// This is disabled by default because it's unusual behavior,
// and overridden by several of the build variants whose output
// cannot be opened in Sublime.
"always_display": false,

// Pandown includes support for the CriticMarkup extension to Markdown.
// For more information, see http://criticmarkup.com.
"preprocess_critic": false,

// There's really no need to make any changes here; the preferred way to set
// all of this is in Packages/User/Pandown.sublime-settings, or in an individual
// project's pandoc-config.json file. If you haven't yet, take a look at
// the readme for information about configuring these options.
"pandoc_arguments":
{
    //////////////////////////////////////////////////////////////////////
    // Arguments are explained in Pandoc's documentation:               //
    // http://johnmacfarlane.net/pandoc/README.html .                   //
    // The contents of this file will be merged with the package's      //
    // Pandown.sublime-settings file, the user's Pandown.sublime-settings/
    // file, and local project settings, with what's specified here     //
    // taking precedence. For more information about how to use this    //
    // file, please see the Pandown README.                             //
    //////////////////////////////////////////////////////////////////////
    "markdown_extensions":
    {
        /////////////////////////
        // MARKDOWN EXTENSIONS //
        /////////////////////////
        // A backslash followed by a newline is also a line break.
        "escaped_line_breaks": true,

        // Require a blank line before a header.
        "blank_before_header": true,

        // Headers can be assigned attributes using this syntax at the end of
        // the line containing the header text:
        // {#identifier .class .class key=value key=value}
        "header_attributes": true,

        // A header without specified attributes will automatically be assigned
        // a unique identifier based on the header text.
        "auto_identifiers": true,

        // Pandoc assumes header references have been defined for each header.
        "implicit_header_references": true,

        // Require a blank line before block quotes. In nested blockquotes,
        // require:
        // > Quotation
        // >
        // > > Quotation within quotation.
        "blank_before_blockquote": true,

        // Fence code blocks off with tildes or backticks.
        "fenced_code_blocks": true,

        // Start lines with pipe characters to and the division into lines and
        // leading whitespace will be preserved. Useful for setting verse and
        // addresses.
        "line_blocks": true,

        // Pandoc allows fancier numbering using uppercase letters, lowercase
        // letters and Roman numerals. List markers may be enclosed in parentheses
        // or followed by a single right-parenthesis or period, then two spaces.
        "fancy_lists": true,

        // Pandoc will pay attention to the starting number for each list.
        "startnum": true,

        // Pandoc supports definition lists; see documentation here for the
        // correct syntax: http://johnmacfarlane.net/pandoc/README.html#definition-lists
        "definition_lists": true,

        // The list marker (@) can be used to sequentially number examples in
        // a way that persists throughout the document.
        "example_lists": true,

        // Pandoc supports four kinds of tables, the syntax for which is given at:
        // http://johnmacfarlane.net/pandoc/README.html#tables.
        "simple_tables": true,
        "multiline_tables": true,
        "grid_tables": true,
        "pipe_tables": true,

        // A table caption is a paragraph beginning with the string "Table:" or a
        // colon alone. It may be placed at the beginning or end of a table.
        "table_captions": true,

        // Pandoc allows the inclusion of a title block that will not appear in
        // the body of the document:
        // % Title
        // % Author(s) (separated by semicolons)
        // % Date
        "pandoc_title_block": true,

        // A backslash may be used to escape any Markdown symbol.
        "all_symbols_escapable": true,

        // Using underscores within a word for emphasis is disabled by
        // default. Use * instead.
        "intraword_underscores": false,

        // To strike letters in your text, surround them with ~~two tildes~~.
        "strikeout": true,

        // Superscripts may be written by surrounding text with ^ characters,
        // subscripts by surrounding text with ~ characters. Escape spaces within
        // scripts using \ .
        "superscript": true,
        "subscript": true,

        // Add attribtues, including syntax highlighting, to inline code.
        "inline_code_attributes": true,

        // Text between two $ characters will be rendered as LaTeX math.
        "tex_math_dollars": true,

        // The default behavior in Markdown allows you to insert raw HTML
        // anywhere in a document.
        "raw_html": true,

        // By default, Pandoc interprets Markdown in blocks of HTML as Markdown.
        // This deviates from Markdown.pl's default behavior.
        "markdown_in_html_blocks": true,

        // Pandoc allows raw TeX to be passed in addition to raw HTML.
        "raw_tex": true,

        // If set to `true`, Pandoc will use \newcommand and \renewcommand
        // definitions in all LaTeX math blocks.
        "latex_macros": true,

        // An image occurring by itself in a paragraph will be rendered as a
        // figure with a caption: ![This is the caption](path/to/image.jpg)
        "implicit_figures": true,

        // Pandoc will parse footnotes in the syntax listed here:
        // http://johnmacfarlane.net/pandoc/README.html#footnotes
        "footnotes": true,
        "inline_notes": true,

        // Use the syntax given here for citations:
        // http://johnmacfarlane.net/pandoc/README.html#citations
        "citations": true,

        // All newlines within a paragraph will be interpreted as linebreaks
        // rather than spaces.
        "hard_line_breaks": false,

        // Anything between \( and \) will be interpreted as TeX inline math,
        // and anything between \[ and \] as TeX display math.
        "tex_math_single_backslash": false,

        // Same as above, but escaped with two backslashes.
        "tex_math_double_backslash": false,

        // Markdown is only parsed within block-level tags if `markdown=1` is
        // set in their attributes.
        "markdown_attribute": false,

        // Enables a MultiMarkdown-style title block:
        // Title:    My Title
        // Author:   Arthur Author
        // Date:     January 1, 2013
        // Comment:  This is a mmd title block, and it even includes
        //           a field spanning multiple lines.
        "mmd_title_block": false,

        // Skip PHP Markdown Extra abbreviation keys instead of parsing them
        // as paragraphs if set to `true`.
        "abbreviations": false,

        // Makes all absolute URLs into links, even when not enclosed in <...>.
        "autolink_bare_uris": false,

        // Parse (but ignore, at the moment) MMD-style key--value attribtues
        // in image and link references.
        "link_attributes": false,

        // Parses MMD-style header identifiers (in square brackets between header
        // text and closing ATX #s.
        "mmd_header_identifiers": false
    },

    "command_arguments":
    {
        ////////////////////////////
        // COMMAND-LINE ARGUMENTS //
        ////////////////////////////
        // Modify this setting to tell Pandoc to look for any of the following
        // in the specified directory rather than ~/.pandoc or Pandoc's default
        // directory tree. Note that this is not an all-purpose includes
        // directory---Pandoc will only look for these files and folders.
        //      data_dir/
        //          |-- reference.odt
        //          |-- reference.docx
        //          |-- default.csl
        //          |-- epub.css
        //          |-- slidy/
        //          |-- slideous/
        //          |-- s5/
        //          |-- templates/
        // Anything placed under templates and will be found by the "template"
        // setting; otherwise, to set an include directory, use the "includes_paths"
        // option above.
        "data-dir": "",

        // "Parse untranslatable HTML codes and LaTeX environments as
        // raw HTML or LaTeX, instead of ignoring them."
        "parse-raw": true,

        // Straight quotes into curly quotes, --- to em-dash, -- to en-dash,
        // ... to ellipsis, nonbreaking spaces after certain abbreviations.
        "smart": true,

        // - before a numeral to en-dash, -- to em-dash
        "old-dashes": false,

        // "Speficy the base level for headers"
        // Specify a number or "false" to disable.
        "base-header-level": false,

        // Apply code classes to all indented code blocks. N.B.:
        // does not apply to fenced code, which must still be
        // configured inline.
        // MUST BE DEFINED AS A LIST, EVEN IF EMPTY. This is correct:
        //      "indented-code-classes": [],
        // and so is this:
        //      "indented-code-classes": [ "numberLines" ],
        // but this is not:
        //      "indented-code-classes": "numberLines"
        "indented-code-classes":
        [
        ],

        // When image paths or URLs have no extension, this one
        // will be used.
        "default-image-extension": "",

        // Merge adjacent elements, remove repeated spaces, etc.
        "normalize": true,

        // Set the number of spaces per tab. Should be set to
        // "false" (for default behavior) or a number.
        "tab-stop": false,

        // Generate "an appropriate header and footer"
        "standalone": true,

        // Use a template file other than the default to
        // generate output. Pandoc will look for a template in the
        // working directory, then data_dir/templates/, then its
        // built-in directory tree.
        // See Pandoc's README for information about templates:
        // http://johnmacfarlane.net/pandoc/README.html#templates
        "template": "",

        // Supply a dict of keys and values to be passed to
        // the template file. Values may be lists
        // if your template includes loops; see this plugin's README.
        "variables":
        {
        },

        // By default, text is wrapped for the output format.
        "no-wrap": false,

        // If wrapping text, wrap to "columns" columns.
        // Specify a number or "false" to disable.
        "columns": false,

        // Generate and include a table of contents.
        "table-of-contents": false,

        // The number of section levels to include in the table of contents.
        // Specify a number or "false" for default (3).
        "toc-depth": false,

        // Disable syntax highlighting globally.
        "no-highlight": false,

        // Style to use for syntax highlighting.
        // Valid highlight_style values:
        // "pygments" (default), "kate", "monochrome",
        // "espresso", "zenburn", "haddock", "tango"
        "highlight-style": "pygments",

        // Supply lists of files---NOT single file names---to include verbatim in the output.
        // This is correct:
        //          "include_in_header": [ "myfile" ]
        // and this is not:
        //          "include_in_header": "myfile"
        // Default templates support multiple includes.
        // Insert just before </head>
        "include-in-header": [],
        // Insert just after <body>
        "include-before-body": [],
        // Insert includes just before </body>
        "include-after-body": [],

        // Convert includes to 'data:' URIs so that the
        // output can be viewed offline.
        "self-contained": false,

        // Use <q> tags for quotes in HTML5 output
        "html-q-tags": false,

        // In HTML output ONLY, restrict to ASCII characters
        // with numerical HTML entities.
        "ascii": false,

        // When outputting Markdown, use reference-style links (e.g. [go here!][1])
        // rather than inline (e.g. [go here!](http://place.the) ).
        "reference-links": false,

        // Force use of ATX-style headers ("# H1", "## H2", etc.) in output.
        // The default is to use a combination, with setext-style headers:
        // H1
        // ===
        //
        // for H1 and H2, then ATX.
        "atx-headers": true,

        // Top-level headers become TeX/Docbook chapters.
        "chapters": false,

        // Generate section numbers.
        "number-sections": false,

        // Sections in HTML output can be offset by a fixed number.
        // The first number is added to the output for top-level
        // headings, the second number to second-level headings,
        // etc. Must be specified as a list.
        "number-offset":
        [
        ],

        // "Do not convert quotation marks, apostrophes, and dashes to the TeX ligatures"
        "no-tex-ligatures": false,

        // Use listings package for TeX code
        "listings": false,

        // In slideshow output, display list items one slide at a time.
        "incremental": false,

        // Header level at which to break slides. Above breaks sections, below
        // creates subheads. Normally set based on context of document.
        // See: http://johnmacfarlane.net/pandoc/README.html#structuring-the-slide-show
        // Set to a number or "false" to disable.
        "slide-level": false,

        // Enclose sections in <div> or <section> tags, attach "id" attributes based on
        // the section name.
        "section-divs": false,

        // Conceal mailto: links from robots.
        // Acceptable values: "none", "javascript", "references"
        "email-obfuscation": "javascript",

        // "Specify a prefix to be added to all automatically generated identifiers
        // in HTML output. This is useful for preventing duplicate identifiers when
        // generating fragments to be included in other pages."
        "id-prefix": "",

        // Insert a string before the header title tag but not the body title
        "title-prefix": "",

        // Link to any number of CSS stylesheets
        // without triggering the standalone include features.
        "css":
        [
        ],

        // "Use the specified file as a style reference in producing a [desired] file.
        // For best results, the reference [file] should be a modified version of
        // a [desired] file produced using pandoc."
        "reference-odt": "",
        "reference-docx": "",

        // "Use the specified CSS file to style the EPUB. If no stylesheet is specified,
        // pandoc will look for a file epub.css in the user data directory (see --data-dir).
        // If it is not found there, sensible defaults will be used."
        "epub-stylesheet": "",

        // Set cover to a specified image.
        "epub-coverimage": "",

        // Link to an XML file containing EPUB metadata in Dublin Core Elements format.
        // See http://dublincore.org/documents/dces/
        "epub-metadata": "",

        // Use the stylesheet specified to embed fonts. Should contain a series of
        // @font-face elements and CSS describing where they're to be used.
        "epub-embed-font": "",

        // Appropriate values: "pdflatex" (default), "xelatex", "lulalatex"
        "latex-engine": "",

        // Specify bibliography database to be used in resolving citations. The database
        // type will be determined from the extension of FILE, which may be .mods (MODS format),
        // .bib (BibTeX/BibLaTeX format), .ris (RIS format), .enl (EndNote format), .xml (EndNote XML format),
        // .wos (ISI format), .medline (MEDLINE format), .copac (Copac format), or .json (citeproc JSON).
        // If you want to use multiple bibliographies, just use this option repeatedly.
        "bibliography": "/Users/Roambot/Dropbox/PDFLibrary/Master.bib",

        // Link to a CSL (http://citationstyles.org) file for formatting citations.
        //"csl": "/Users/Roambot/.pandoc/apa.csl",
        "csl": "/Users/Roambot/.pandoc/chicago-author-date.csl",

        // "Specify a file containing abbreviations for journal titles and other
        // bibliographic fields (indicated by setting form="short" in the CSL node
        // for the field). The format is described at
        // http://citationstylist.org/2011/10/19/abbreviations-for-zotero-test-release/"
        "citation-abbreviations": "",

        // Use natbib for LaTeX citations.
        "natbib": false,

        // Use BibLaTeX for LaTeX citations.
        "biblatex": false,

        // Place TeX math between <eq> tags in HTML output.
        "gladtex": false,

        // Each of the following can be false, true, or a URL string.
        // Setting to a URL string implies true.
        // Use http://math.etsu.edu/LaTeXMathML/ to format TeX math. If no URL
        // is specified, Pandoc will insert the code for you.
        "latexmathml": false,
        // Convert TeX math to MathML and include a JavaScript to display.
        "mathml": false,
        // Use http://www.math.union.edu/~dpvc/jsmath/ for TeX math. URL must point
        // to its load script, which will not be automatically added by Pandoc.
        "jsmath": false,
        // Use http://www.mathjax.org/ for TeX math. URL must point to MathJax.jds
        // load script. If no URL is provided, Pandoc script will add one.
        "mathjax": false,
        // Render TeX math with mimetex (http://www.forkosh.com/mimetex.html). If no
        // URL is supplied, /cgi-bin/mimetex.cgi is assumed.
        "mimetex": false,
        // Render TeX formulas using an external script that converts TeX formulas
        // to images. The formula will be concatenated with the URL provided.
        // If URL is not specified, the Google Chart API will be used.
        "webtex": false
    }
}

}

phyllisstein commented 10 years ago

Hm, those look pretty standard---looks like the only change is to atx-headers, no? Let's try a couple of things: first, add the PANDOWN_DEBUG line to your user configuration, so that it looks like this:

{
  "PANDOWN_DEBUG": true
  // ...your settings follow...
}

Just pop that line into your user configuration file, which you can access under "Preferences→Package Settings→Pandown→Settings - User," then save it and try running the build again and let me know what appears in the Sublime console. (You can access that on OS X by pressing ⌘+</kbd>; I imagine that on Windows and Linux it's <kbd>Ctrl+.) Feel free to munge anything non-essential---paths and filenames and stuff---if you'd like.

The next thing to try is running Pandoc from the command line with --atx-headers rather than --atx. Since Pandoc apparently just dropped the invalid argument, we still don't know whether this is something the package is doing or Pandoc is doing; since all the package does is pass a command to Pandoc, it'll be helpful to know which side of that equation is unbalanced.

Finally, it might help if I could see some of the Markdown you're working with---or, failing that, if you could try compiling a simple substitute document that works on my end, to see whether it does or doesn't on yours. E.g., try this:

# H1
"_Je suis l'Markdown de luxe_!" is a made-up French phrase.

## H2
"_Yo soy Markdown adorno_!" is a made-up Spanish phrase with a Marxist in it.

…which, for me, compiles to this:

<div id="h1" class="section level1">
<h1>H1</h1>
<p>“<em>Je suis l’Markdown de luxe</em>!” is a made-up French phrase.</p>
<div id="h2" class="section level2">
<h2>H2</h2>
<p>“<em>Yo soy Markdown adorno</em>!” is a made-up Spanish phrase with a Marxist in it.</p>
</div>
</div>

…and see what you get. We'll squash this yet.

mclearc commented 10 years ago

Thanks again. I've run Pandoc from the command line, everything works fine (fyi '--atx' apparently works the same as the correct '--atx-headers'), which means it is something to do with Pandown, not Pandoc. So here's what came out of the console when I tried to convert a .md to md (I like to tidy up my markdown docs this way) in Sublime Text 3. I can paste in the markdown too if you like, though there is nothing special about it.

Loading dictionary Packages/Language - English/en_US.dic startup time: 0.360867 unknown include #documentation unknown include #documentation unknown include #documentation unknown include #documentation unknown include #documentation unknown include #documentation unknown include #documentation unknown include #documentation unknown include #documentation launching: /Applications/Sublime Text.app/Contents/MacOS/plugin_host reloading plugin Default.block reloading plugin Default.comment reloading plugin Default.copy_path reloading plugin Default.delete_word reloading plugin Default.detect_indentation reloading plugin Default.duplicate_line reloading plugin Default.echo reloading plugin Default.exec reloading plugin Default.fold reloading plugin Default.font reloading plugin Default.goto_line reloading plugin Default.history_list reloading plugin Default.indentation reloading plugin Default.kill_ring reloading plugin Default.mark reloading plugin Default.new_templates reloading plugin Default.open_file_settings reloading plugin Default.open_in_browser reloading plugin Default.pane reloading plugin Default.paragraph reloading plugin Default.paste_from_history reloading plugin Default.save_on_focus_lost reloading plugin Default.scroll reloading plugin Default.set_unsaved_view_name reloading plugin Default.side_bar reloading plugin Default.sort reloading plugin Default.swap_line reloading plugin Default.switch_file reloading plugin Default.symbol reloading plugin Default.transform reloading plugin Default.transpose reloading plugin Default.trim_trailing_white_space reloading plugin CSS.css_completions reloading plugin Diff.diff reloading plugin HTML.encode_html_entities reloading plugin HTML.html_completions reloading plugin FullScreenStatus.main reloading plugin Google Spell Check.google-spell-check reloading plugin MarkdownEditing.bootstrap reloading plugin MarkdownEditing.custom_find_under_expand reloading plugin MarkdownEditing.distraction_free_mode reloading plugin MarkdownEditing.footnotes reloading plugin MarkdownEditing.gather_missing_links reloading plugin MarkdownEditing.indent_list_item reloading plugin MarkdownEditing.insert_references reloading plugin MarkdownEditing.jumpToMarker reloading plugin MarkdownEditing.list_markdown_references reloading plugin MarkdownEditing.numbered_list reloading plugin MarkdownEditing.paste_as_link reloading plugin MarkdownEditing.paste_as_reference reloading plugin MarkdownEditing.quote_indenting reloading plugin MarkdownEditing.underlined_headers reloading plugin Marked App Menu.marked reloading plugin Open URL.example reloading plugin Open URL.open_url reloading plugin Package Control.Package Control reloading plugin Pandown.minify_json reloading plugin Pandown.pandownBuildCommand reloading plugin Pandown.pandownCriticPreprocessor reloading plugin Pandown.pandownProcess reloading plugin Pandown.pandownTouchProjectConfigCommand reloading plugin Preference Helper.Preference Helper reloading plugin ReadmePlease.ReadmePlease reloading plugin SideBarEnhancements.Edit reloading plugin SideBarEnhancements.SideBar reloading plugin SideBarEnhancements.SideBarDefaultDisable reloading plugin SideBarEnhancements.StatusBarFileSize reloading plugin SideBarEnhancements.StatusBarModifiedTime reloading plugin SublimeGit.SublimeGit reloading plugin Surround.Surround reloading plugin SyncedSideBar.SyncedSideBar reloading plugin Vintageous.init reloading plugin Vintageous.builder reloading plugin Vintageous.ex_commands loaded 855 snippets reloading plugin Vintageous.ex_main reloading plugin Vintageous.ex_motions reloading plugin Vintageous.jump_list_cmds reloading plugin Vintageous.modelines reloading plugin Vintageous.state Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 70, in reload_plugin unload_module(m) File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 38, in unload_module module.plugin_unloaded() File "state in /Users/Roambot/Library/Application Support/Sublime Text 3/Installed Packages/Vintageous.sublime-package", line 140, in plugin_unloaded AttributeError: 'NoneType' object has no attribute 'settings' reloading plugin Vintageous.test_runner reloading plugin Vintageous.toplist reloading plugin Vintageous.xactions reloading plugin Vintageous.xmotions reloading plugin Vintageous.xsupport reloading plugin WordCount.WordCount reloading plugin WordHighlight.word_highlight reloading plugin Wrap Plus.wrap_plus reloading plugin LaTeXTools.delete_temp_files reloading plugin LaTeXTools.getTeXRoot reloading plugin LaTeXTools.jumpToPDF reloading plugin LaTeXTools.latex_cite_completions reloading plugin LaTeXTools.latex_ref_cite_completions reloading plugin LaTeXTools.latex_ref_completions reloading plugin LaTeXTools.latexCommand reloading plugin LaTeXTools.latexEnvCloser reloading plugin LaTeXTools.latexEnvironment reloading plugin LaTeXTools.makePDF reloading plugin LaTeXTools.parseTeXlog reloading plugin LaTeXTools.texMacro reloading plugin LaTeXTools.texSections reloading plugin LaTeXTools.toggle_auto reloading plugin LaTeXTools.toggle_focus reloading plugin LaTeXTools.toggle_fwdsync reloading plugin LaTeXTools.toggle_show reloading plugin LaTeXTools.viewPDF reloading plugin MacTerminal.open_mac_terminal reloading plugin PlainTasks.PlainTasks plugins loaded reloading Packages/User/Side Bar.sublime-settings Package Control: No updated packages Reloading /Users/Roambot/Dropbox/Work/Teaching/Modern/Assignments/Mid-Term.md Writing file /Users/Roambot/Dropbox/Work/Teaching/Modern/Assignments/Mid-Term.md with encoding UTF-8 (atomic) 'NoneType' object is not subscriptable Could not close temp file... 'NoneType' object is not subscriptable Reloading /Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines/Meditation2.md Reloading /Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines/Meditation2.md Writing file /Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines/Meditation2.md with encoding UTF-8 (atomic) 'NoneType' object is not subscriptable Could not close temp file... 'NoneType' object is not subscriptable Reloading /Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines/Meditation5.md Writing file /Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines/Meditation5.md with encoding UTF-8 (atomic) 'NoneType' object is not subscriptable Could not close temp file... 'NoneType' object is not subscriptable Writing file /Users/Roambot/Library/Application Support/Sublime Text 3/Packages/User/Pandown.sublime-settings with encoding UTF-8 (atomic) Writing file /Users/Roambot/Dropbox/Work/Teaching/Modern/Assignments/Mid-Term.md with encoding UTF-8 (atomic) error: Error trying to parse settings: Expected character in Packages/User/Pandown.sublime-settings:491:1 Writing file /Users/Roambot/Library/Application Support/Sublime Text 3/Packages/User/Pandown.sublime-settings with encoding UTF-8 (atomic) reloading Packages/User/Pandown.sublime-settings error: Error trying to parse settings: Expected character in Packages/User/Pandown.sublime-settings:492:1 Writing file /Users/Roambot/Library/Application Support/Sublime Text 3/Packages/User/Pandown.sublime-settings with encoding UTF-8 (atomic) reloading Packages/User/Pandown.sublime-settings Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublimeplugin.py", line 543, in run return self.run(edit, **args) File "xactions in /Users/Roambot/Library/Application Support/Sublime Text 3/Installed Packages/Vintageous.sublime-package", line 1516, in run TypeError: object of type 'NoneType' has no len() [Pandown: Looking for pandoc-config.json] [Pandown: allFolders: ['/Users/Roambot/Dropbox/Work/Teaching']] [Pandown: name: PaperOne] [Pandown: name: PaperTwo] [Pandown: name: Readings_11:7] [Pandown: name: Readings_9:19] [Pandown: name: Readings_9:26] [Pandown: name: Readings_9:5] [Pandown: name: Assignments] [Pandown: name: Handouts] [Pandown: name: Notes] [Pandown: name: Readings] [Pandown: name: Drafts] [Pandown: name: Final] [Pandown: name: Draft] [Pandown: name: Final] [Pandown: name: Draft4] [Pandown: name: Final4] [Pandown: name: Paper1] [Pandown: name: Paper2] [Pandown: name: Paper3] [Pandown: name: Paper4] [Pandown: name: Paper5] [Pandown: name: Handout] [Pandown: name: Borgmann] [Pandown: name: Bostrom] [Pandown: name: Chalmers] [Pandown: name: Comstock] [Pandown: name: Deryfus] [Pandown: name: Drexler] [Pandown: name: Heidegger] [Pandown: name: Kaplan] [Pandown: name: Kurzweil#1] [Pandown: name: Kurzweil#2] [Pandown: name: Marcuse] [Pandown: name: Marx] [Pandown: name: Savulescu] [Pandown: name: Papers] [Pandown: name: Responses] [Pandown: name: Class Notes] [Pandown: name: Files] [Pandown: name: ReadingResponses] [Pandown: name: heads] [Pandown: name: refs] [Pandown: name: 0b] [Pandown: name: 28] [Pandown: name: 31] [Pandown: name: 39] [Pandown: name: 5a] [Pandown: name: 75] [Pandown: name: 7f] [Pandown: name: 80] [Pandown: name: 81] [Pandown: name: 9e] [Pandown: name: a7] [Pandown: name: ac] [Pandown: name: b1] [Pandown: name: b9] [Pandown: name: c3] [Pandown: name: d4] [Pandown: name: d5] [Pandown: name: fc] [Pandown: name: info] [Pandown: name: pack] [Pandown: name: heads] [Pandown: name: tags] [Pandown: name: hooks] [Pandown: name: info] [Pandown: name: logs] [Pandown: name: objects] [Pandown: name: refs] [Pandown: name: .git] [Pandown: name: origin] [Pandown: name: heads] [Pandown: name: remotes] [Pandown: name: refs] [Pandown: name: 00] [Pandown: name: 02] [Pandown: name: 0b] [Pandown: name: 0e] [Pandown: name: 0f] [Pandown: name: 10] [Pandown: name: 11] [Pandown: name: 15] [Pandown: name: 16] [Pandown: name: 20] [Pandown: name: 29] [Pandown: name: 2d] [Pandown: name: 2f] [Pandown: name: 30] [Pandown: name: 31] [Pandown: name: 32] [Pandown: name: 33] [Pandown: name: 37] [Pandown: name: 38] [Pandown: name: 46] [Pandown: name: 47] [Pandown: name: 4c] [Pandown: name: 4f] [Pandown: name: 51] [Pandown: name: 53] [Pandown: name: 54] [Pandown: name: 56] [Pandown: name: 5f] [Pandown: name: 66] [Pandown: name: 67] [Pandown: name: 6b] [Pandown: name: 6f] [Pandown: name: 70] [Pandown: name: 72] [Pandown: name: 7c] [Pandown: name: 7e] [Pandown: name: 80] [Pandown: name: 81] [Pandown: name: 87] [Pandown: name: 8b] [Pandown: name: 8d] [Pandown: name: 97] [Pandown: name: 9a] [Pandown: name: a7] [Pandown: name: ac] [Pandown: name: b0] [Pandown: name: b7] [Pandown: name: c1] [Pandown: name: c4] [Pandown: name: c5] [Pandown: name: c6] [Pandown: name: c7] [Pandown: name: c9] [Pandown: name: cf] [Pandown: name: db] [Pandown: name: dd] [Pandown: name: e1] [Pandown: name: ef] [Pandown: name: f0] [Pandown: name: fc] [Pandown: name: info] [Pandown: name: pack] [Pandown: name: origin] [Pandown: name: heads] [Pandown: name: remotes] [Pandown: name: tags] [Pandown: name: hooks] [Pandown: name: info] [Pandown: name: logs] [Pandown: name: objects] [Pandown: name: refs] [Pandown: name: .git] [Pandown: name: Assignments] [Pandown: name: Grades] [Pandown: name: Handouts] [Pandown: name: LectureOutlines] [Pandown: name: ModernArchive] [Pandown: name: ModernPhilosophyNotes] [Pandown: name: PDFs] [Pandown: name: Sample Syllabi] [Pandown: name: class1.key] [Pandown: name: class10.key] [Pandown: name: class11.key] [Pandown: name: class13.key] [Pandown: name: class14.key] [Pandown: name: class2.key] [Pandown: name: class3.key] [Pandown: name: class4.key] [Pandown: name: class5.key] [Pandown: name: class6.key] [Pandown: name: class7.key] [Pandown: name: class8.key] [Pandown: name: Class9.key] [Pandown: name: Mid-TermReview.key] [Pandown: name: Pdfs] [Pandown: name: untitled folder] [Pandown: name: KeynoteSlides] [Pandown: name: MarkdownSlides] [Pandown: name: Francesca] [Pandown: name: Ian] [Pandown: name: Kim] [Pandown: name: OldMarkdownSlides] [Pandown: name: OldSlides] [Pandown: name: Paper1] [Pandown: name: Fall 2013] [Pandown: name: Spring 2013] [Pandown: name: Final Exam] [Pandown: name: Mid-Term] [Pandown: name: Papers] [Pandown: name: Images] [Pandown: name: Reports] [Pandown: name: SessionData] [Pandown: name: Introduction to Philosophy-PHIL 101-350] [Pandown: name: Frameworks] [Pandown: name: MacOS] [Pandown: name: Resources] [Pandown: name: Contents] [Pandown: name: Frameworks] [Pandown: name: MacOS] [Pandown: name: Resources] [Pandown: name: Contents] [Pandown: name: _notes] [Pandown: name: hlimages] [Pandown: name: images] [Pandown: name: Frameworks] [Pandown: name: MacOS] [Pandown: name: Resources] [Pandown: name: Contents] [Pandown: name: Cms Integrate Wizard.app] [Pandown: name: Frameworks] [Pandown: name: MacOS] [Pandown: name: Resources] [Pandown: name: Contents] [Pandown: name: Classes] [Pandown: name: i>clicker.app] [Pandown: name: i>grader.app] [Pandown: name: iclicker Help] [Pandown: name: Resources] [Pandown: name: WebUpdate.app] [Pandown: name: Slides] [Pandown: name: Old] [Pandown: name: 101Archive] [Pandown: name: Assignments] [Pandown: name: Grades] [Pandown: name: Handouts] [Pandown: name: iclicker Mac v6.2.1] [Pandown: name: IntroFiles] [Pandown: name: KeynoteSlides] [Pandown: name: Lecture Outlines] [Pandown: name: MarkdownSlides] [Pandown: name: ConceptualismSeminar] [Pandown: name: FWS_Technology] [Pandown: name: Modern] [Pandown: name: Phil101] [Pandown: name: Syllabi] [Pandown: name: Tutorial] [Pandown: topLevel: /Users/Roambot/Dropbox/Work/Teaching] [Pandown: Initial checkDIR: /Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines] [Pandown: Couldn't find config file in project path.] [Pandown: ['pandoc', '--output=/Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines/Meditation1.mdown', '--to=markdown+lhs', '--from=markdown+multiline_tables-mmd_header_identifiers+raw_html+all_symbols_escapable+definition_lists+line_blocks+blank_before_header+table_captions-abbreviations-mmd_title_block+subscript+latex_macros-autolink_bare_uris+auto_identifiers+implicit_figures+implicit_header_references-tex_math_double_backslash+strikeout+example_lists+inline_notes+footnotes-link_attributes+escaped_line_breaks-hard_line_breaks+raw_tex+simple_tables+superscript+inline_code_attributes+startnum+pandoc_title_block+grid_tables+tex_math_dollars-markdown_attribute+fancy_lists+markdown_in_html_blocks+blank_before_blockquote+fenced_code_blocks+citations-intraword_underscores-tex_math_single_backslash+header_attributes+pipe_tables', '--bibliography=/Users/Roambot/Dropbox/PDFLibrary/Master.bib', '--parse-raw', '--standalone', '--normalize', '--csl=/Users/Roambot/.pandoc/chicago-author-date.csl', '--email-obfuscation=javascript', '--highlight-style=pygments', '--atx-headers', '--smart', '/Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines/Meditation1.md']] 'NoneType' object is not subscriptable Could not close temp file... 'NoneType' object is not subscriptable 'NoneType' object is not subscriptable Could not close temp file... 'NoneType' object is not subscriptable 'NoneType' object is not subscriptable Could not close temp file... 'NoneType' object is not subscriptable 'NoneType' object is not subscriptable Could not close temp file... 'NoneType' object is not subscriptable [Pandown: Looking for pandoc-config.json] [Pandown: allFolders: ['/Users/Roambot/Dropbox/Work/Teaching']] [Pandown: name: PaperOne] [Pandown: name: PaperTwo] [Pandown: name: Readings_11:7] [Pandown: name: Readings_9:19] [Pandown: name: Readings_9:26] [Pandown: name: Readings_9:5] [Pandown: name: Assignments] [Pandown: name: Handouts] [Pandown: name: Notes] [Pandown: name: Readings] [Pandown: name: Drafts] [Pandown: name: Final] [Pandown: name: Draft] [Pandown: name: Final] [Pandown: name: Draft4] [Pandown: name: Final4] [Pandown: name: Paper1] [Pandown: name: Paper2] [Pandown: name: Paper3] [Pandown: name: Paper4] [Pandown: name: Paper5] [Pandown: name: Handout] [Pandown: name: Borgmann] [Pandown: name: Bostrom] [Pandown: name: Chalmers] [Pandown: name: Comstock] [Pandown: name: Deryfus] [Pandown: name: Drexler] [Pandown: name: Heidegger] [Pandown: name: Kaplan] [Pandown: name: Kurzweil#1] [Pandown: name: Kurzweil#2] [Pandown: name: Marcuse] [Pandown: name: Marx] [Pandown: name: Savulescu] [Pandown: name: Papers] [Pandown: name: Responses] [Pandown: name: Class Notes] [Pandown: name: Files] [Pandown: name: ReadingResponses] [Pandown: name: heads] [Pandown: name: refs] [Pandown: name: 0b] [Pandown: name: 28] [Pandown: name: 31] [Pandown: name: 39] [Pandown: name: 5a] [Pandown: name: 75] [Pandown: name: 7f] [Pandown: name: 80] [Pandown: name: 81] [Pandown: name: 9e] [Pandown: name: a7] [Pandown: name: ac] [Pandown: name: b1] [Pandown: name: b9] [Pandown: name: c3] [Pandown: name: d4] [Pandown: name: d5] [Pandown: name: fc] [Pandown: name: info] [Pandown: name: pack] [Pandown: name: heads] [Pandown: name: tags] [Pandown: name: hooks] [Pandown: name: info] [Pandown: name: logs] [Pandown: name: objects] [Pandown: name: refs] [Pandown: name: .git] [Pandown: name: origin] [Pandown: name: heads] [Pandown: name: remotes] [Pandown: name: refs] [Pandown: name: 00] [Pandown: name: 02] [Pandown: name: 0b] [Pandown: name: 0e] [Pandown: name: 0f] [Pandown: name: 10] [Pandown: name: 11] [Pandown: name: 15] [Pandown: name: 16] [Pandown: name: 20] [Pandown: name: 29] [Pandown: name: 2d] [Pandown: name: 2f] [Pandown: name: 30] [Pandown: name: 31] [Pandown: name: 32] [Pandown: name: 33] [Pandown: name: 37] [Pandown: name: 38] [Pandown: name: 46] [Pandown: name: 47] [Pandown: name: 4c] [Pandown: name: 4f] [Pandown: name: 51] [Pandown: name: 53] [Pandown: name: 54] [Pandown: name: 56] [Pandown: name: 5f] [Pandown: name: 66] [Pandown: name: 67] [Pandown: name: 6b] [Pandown: name: 6f] [Pandown: name: 70] [Pandown: name: 72] [Pandown: name: 7c] [Pandown: name: 7e] [Pandown: name: 80] [Pandown: name: 81] [Pandown: name: 87] [Pandown: name: 8b] [Pandown: name: 8d] [Pandown: name: 97] [Pandown: name: 9a] [Pandown: name: a7] [Pandown: name: ac] [Pandown: name: b0] [Pandown: name: b7] [Pandown: name: c1] [Pandown: name: c4] [Pandown: name: c5] [Pandown: name: c6] [Pandown: name: c7] [Pandown: name: c9] [Pandown: name: cf] [Pandown: name: db] [Pandown: name: dd] [Pandown: name: e1] [Pandown: name: ef] [Pandown: name: f0] [Pandown: name: fc] [Pandown: name: info] [Pandown: name: pack] [Pandown: name: origin] [Pandown: name: heads] [Pandown: name: remotes] [Pandown: name: tags] [Pandown: name: hooks] [Pandown: name: info] [Pandown: name: logs] [Pandown: name: objects] [Pandown: name: refs] [Pandown: name: .git] [Pandown: name: Assignments] [Pandown: name: Grades] [Pandown: name: Handouts] [Pandown: name: LectureOutlines] [Pandown: name: ModernArchive] [Pandown: name: ModernPhilosophyNotes] [Pandown: name: PDFs] [Pandown: name: Sample Syllabi] [Pandown: name: class1.key] [Pandown: name: class10.key] [Pandown: name: class11.key] [Pandown: name: class13.key] [Pandown: name: class14.key] [Pandown: name: class2.key] [Pandown: name: class3.key] [Pandown: name: class4.key] [Pandown: name: class5.key] [Pandown: name: class6.key] [Pandown: name: class7.key] [Pandown: name: class8.key] [Pandown: name: Class9.key] [Pandown: name: Mid-TermReview.key] [Pandown: name: Pdfs] [Pandown: name: untitled folder] [Pandown: name: KeynoteSlides] [Pandown: name: MarkdownSlides] [Pandown: name: Francesca] [Pandown: name: Ian] [Pandown: name: Kim] [Pandown: name: OldMarkdownSlides] [Pandown: name: OldSlides] [Pandown: name: Paper1] [Pandown: name: Fall 2013] [Pandown: name: Spring 2013] [Pandown: name: Final Exam] [Pandown: name: Mid-Term] [Pandown: name: Papers] [Pandown: name: Images] [Pandown: name: Reports] [Pandown: name: SessionData] [Pandown: name: Introduction to Philosophy-PHIL 101-350] [Pandown: name: Frameworks] [Pandown: name: MacOS] [Pandown: name: Resources] [Pandown: name: Contents] [Pandown: name: Frameworks] [Pandown: name: MacOS] [Pandown: name: Resources] [Pandown: name: Contents] [Pandown: name: _notes] [Pandown: name: hlimages] [Pandown: name: images] [Pandown: name: Frameworks] [Pandown: name: MacOS] [Pandown: name: Resources] [Pandown: name: Contents] [Pandown: name: Cms Integrate Wizard.app] [Pandown: name: Frameworks] [Pandown: name: MacOS] [Pandown: name: Resources] [Pandown: name: Contents] [Pandown: name: Classes] [Pandown: name: i>clicker.app] [Pandown: name: i>grader.app] [Pandown: name: iclicker Help] [Pandown: name: Resources] [Pandown: name: WebUpdate.app] [Pandown: name: Slides] [Pandown: name: Old] [Pandown: name: 101Archive] [Pandown: name: Assignments] [Pandown: name: Grades] [Pandown: name: Handouts] [Pandown: name: iclicker Mac v6.2.1] [Pandown: name: IntroFiles] [Pandown: name: KeynoteSlides] [Pandown: name: Lecture Outlines] [Pandown: name: MarkdownSlides] [Pandown: name: ConceptualismSeminar] [Pandown: name: FWS_Technology] [Pandown: name: Modern] [Pandown: name: Phil101] [Pandown: name: Syllabi] [Pandown: name: Tutorial] [Pandown: topLevel: /Users/Roambot/Dropbox/Work/Teaching] [Pandown: Initial checkDIR: /Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines] [Pandown: Couldn't find config file in project path.] [Pandown: ['pandoc', '--output=/Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines/Meditation1.mdown', '--to=markdown+lhs', '--from=markdown+multiline_tables-mmd_header_identifiers+raw_html+all_symbols_escapable+definition_lists+line_blocks+blank_before_header+table_captions-abbreviations-mmd_title_block+subscript+latex_macros-autolink_bare_uris+auto_identifiers+implicit_figures+implicit_header_references-tex_math_double_backslash+strikeout+example_lists+inline_notes+footnotes-link_attributes+escaped_line_breaks-hard_line_breaks+raw_tex+simple_tables+superscript+inline_code_attributes+startnum+pandoc_title_block+grid_tables+tex_math_dollars-markdown_attribute+fancy_lists+markdown_in_html_blocks+blank_before_blockquote+fenced_code_blocks+citations-intraword_underscores-tex_math_single_backslash+header_attributes+pipe_tables', '--bibliography=/Users/Roambot/Dropbox/PDFLibrary/Master.bib', '--parse-raw', '--standalone', '--normalize', '--csl=/Users/Roambot/.pandoc/chicago-author-date.csl', '--email-obfuscation=javascript', '--highlight-style=pygments', '--atx-headers', '--smart', '/Users/Roambot/Dropbox/Work/Teaching/Modern/LectureOutlines/Meditation1.md']]

phyllisstein commented 10 years ago

Hum, interesting---it looks like it's something to do with the --to=markdown+lhs setting. I was just going straight to HTML, and didn't realize you were trying to render Literate Haskell. I don't know much about LHS, but it looks like Pandoc converts H1- and H2-level headers to setext style and just eats the rest when creating it.

LHS weirdnesses aside, at least till I can dig through the docs, it sounds like what you're actually looking for is a straight Markdown-to-Markdown build system. If I'm not wrong about that, then I can push a change pretty fast.

mclearc commented 10 years ago

right - lhs doesn't really matter to me, I just want to be able to write a markdown doc and easily tidy it (clean hard-wrapping and indentation, etc.). One other question. How do you go about changing the extension that is used in the result of the build process? I like to have all my markdown files as .md. Currently the build for markdown results in a .mdown file. Is this changeable? Thanks!

phyllisstein commented 10 years ago

Good news! In that case, the commit I just pushed will enable a build option in the Command Palette called "Build: Pandoc: Markdown." It'll build straight from Markdown to Markdown, without any bizarre Haskell intermediary. If you want to create a keyboard shortcut for it, you might add something like this to your user keymap (Preferences→Key Bindings - User):

[
  {
    "keys": ["super+alt+b"],
    "command": "pandown_build",
    "args":
    {
      "pandoc_to": ["markdown", ".md"]
    }
  }
]

I also changed the extension in deference to what I think is probably more common (though I quite like .mdown myself).

mclearc commented 10 years ago

that works great - thanks!