Skip to content

Commit

Permalink
Fixes regressions in previous version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Shannon committed Aug 17, 2013
1 parent 7db0420 commit 50e2402
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Main.sublime-menu
Expand Up @@ -35,7 +35,7 @@
{
"command": "open_file", "args":
{
"file": "Pandown.sublime-settings"
"file": "${packages}/Pandown/Pandown.sublime-settings"
},
"caption": "Settings – Default"
},
Expand Down
20 changes: 10 additions & 10 deletions Pandown.sublime-settings
Expand Up @@ -223,14 +223,14 @@
// 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/
// |-- 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.
Expand Down Expand Up @@ -316,7 +316,7 @@
// "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" ]
Expand Down Expand Up @@ -388,7 +388,7 @@

// Conceal mailto: links from robots.
// Acceptable values: "none", "javascript", "references"
"email-obfuscation": "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
Expand Down
7 changes: 5 additions & 2 deletions changelog.mdown
Expand Up @@ -3,9 +3,12 @@
## Notes
As of March 2013, Pandown is _fully compatible with Sublime Text 2 and Sublime Text 3_. "Pandown3" was ported back to ST2, bringing benefits to stability and performance, compatibility with Pandoc versions higher than 1.10, and dual-compatibility, in one Github repository and one project, with the two most recent versions of Sublime. "Pandown3" will no longer be supported; any changes and improvements made will be to the single repository available at <https://github.com/phyllisstein/Pandown>. The stable version is being assigned the number 2.0, and was completed on 25 March 2013.

# Changes and Improvements---03/26/13
## Changes and Improvements---08/17/13
* Regressions in last version that went unnoticed till I installed a fresh ST3 should be corrected.

## Changes and Improvements---03/26/13
* Dual compatibility with ST2 and ST3.
* The `pandoc-config.json` file now uses a slightly different syntax. In order to accommodate Pandoc's new Markdown-extensions feature, the configuration files were split into two dictionaries, `"markdown_extensions"` and `"command_arguments"`. See the default configuration file at `{Packages}/default-pandoc-config.json`, or the settings files, for a guide to what now belongs where. _Users **must** update their `pandoc-config.json` and `{Packages}/User/Pandown.sublime-settings` files_.
* Pandown now supports the CriticMarkup syntax, showcased at <http://criticmarkup.com>. Though disabled by default, it can be enabled by setting the `"preprocess_critic"` option to `true` in your `.sublime-settings` file and passing the variable `"critic": true` in your `pandoc-config.json` file. If you're not using the included "Github" template, you'll need to copy everything from `$if(critic)$` to the next `$endif$` out of that template and paste it into your own.
* Pandown now builds considerably faster, and its code has been somewhat sanitized.
* Brett's "Github" template has been further modified to increase compatibility with Pandoc. The aesthetics are all still his work, but some of the behind-the-scenes stuff has changed to improve---e.g.---code blocks with line numbers and some other small additional features.
* Brett's "Github" template has been further modified to increase compatibility with Pandoc. The aesthetics are all still his work, but some of the behind-the-scenes stuff has changed to improve---e.g.---code blocks with line numbers and some other small additional features.
9 changes: 5 additions & 4 deletions messages.json
@@ -1,6 +1,7 @@
{
"install": "messages/install.txt",
"2013.03.27.22.00.00": "messages/2.0.0.txt",
"2013.03.27.22.05.57": "messages/2.1.0.txt",
"2013.05.12.20.30.00": "messages/2.2.0.txt"
"install": "messages/install.txt",
"2013.03.27.22.00.00": "messages/2.0.0.txt",
"2013.03.27.22.05.57": "messages/2.1.0.txt",
"2013.05.12.20.30.00": "messages/2.2.0.txt",
"2013.08.17.12.00.00": "messages/2.3.0.txt"
}
7 changes: 7 additions & 0 deletions messages/2.3.0.txt
@@ -0,0 +1,7 @@
PANDOWN FOR SUBLIME TEXT 2 & 3
by Daniel Shannon
======================================
Fixed several regressions in
recent versions of Pandown that
went unnoticed till I myself
started with a fresh Sublime setup.
3 changes: 2 additions & 1 deletion pandownBuildCommand.py
Expand Up @@ -233,6 +233,7 @@ def walkIncludes(self, lookFor, prepend=None):
return prepend + lookFor if prepend else lookFor
# Is the file in the includes_paths?
for pathToCheck in self.includes_paths:
pathToCheck = os.path.expanduser(pathToCheck)
pathToCheck = os.path.abspath(pathToCheck)
fileToCheck = os.path.join(pathToCheck, lookFor)
if os.path.isfile(fileToCheck):
Expand Down Expand Up @@ -273,7 +274,7 @@ def buildPandocCmd(self, inFile, to, pandoc_from, a):
s["command_arguments"]["css"].extend(a["command_arguments"].pop("css", []))
s["command_arguments"]["number-offset"].extend(a["command_arguments"].pop("number-offset", []))
s["command_arguments"].update(a["command_arguments"])
s["markdown_extensions"].update(a["markdown_extensions"])
s["markdown_extensions"].update(a.get("markdown_extensions", {}))

configLoc = self.walkIncludes("pandoc-config.json")
if configLoc:
Expand Down
4 changes: 2 additions & 2 deletions pandownProcess.py
Expand Up @@ -4,7 +4,6 @@
import time
import os
import subprocess
import sys
import threading
import functools

Expand Down Expand Up @@ -90,7 +89,7 @@ def read_stderr(self):


class PandownExecCommand(sublime_plugin.WindowCommand, PandownProcessListener):
def run(self, cmd=None, env={}, file_regex="", line_regex="", encoding="utf-8", quiet=False, kill=False, word_wrap=True, syntax="Packages/Text/Plain text.tmLanguage", working_dir="", output_view=None, **kwargs):
def run(self, cmd=None, env={}, file_regex="", line_regex="", encoding="utf-8", quiet=True, kill=False, word_wrap=True, syntax="Packages/Text/Plain text.tmLanguage", working_dir="", output_view=None, **kwargs):
__ST3 = int(sublime.version()) >= 3000
if kill:
if self.proc:
Expand Down Expand Up @@ -268,3 +267,4 @@ def on_data_err(self, proc, data):

def on_finished(self, proc):
sublime.set_timeout(functools.partial(self.finish, proc), 0)
proc), 0)
4 changes: 3 additions & 1 deletion pandownTouchProjectConfigCommand.py
Expand Up @@ -3,6 +3,7 @@
import sublime_plugin
import os
import shutil
import codecs


class PandownTouchProjectConfigCommand(sublime_plugin.WindowCommand):
Expand All @@ -27,8 +28,9 @@ def run(self):
sublime.status_message("Could not load default Pandoc configuration.")
print("[Pandown could not find a default configuration file in Packages/Pandown/default-pandoc-config.json]")
print("[Loading from the binary package resource file also failed.]")
print("[e: {0}]".format(e))
return
with open(configFile, "w") as f:
with codecs.open(configFile, "w", "utf-8") as f:
f.write(s)
self.window.open_file(configFile)

Expand Down

5 comments on commit 50e2402

@dotherightthing
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Has this been tested on ST2 as well? I'm experiencing (possibly unrelated) Pandown build failures which I wasn't experiencing a week ago.

I'm running 2.0.2, Build 2221

Thanks,
Dan

@phyllisstein
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Dan,
I'll plug it into ST2 and see if anything goes awry; in the meantime, is a backtrace showing up in the console?

@dotherightthing
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, there's nothing in the console when I run the Build, but I get the following when I start Sublime:

    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/CSS/css_completions.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/Default/comment.py
    [...other default plugins]
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/Diff/diff.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/FileDiffs/file_diffs.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/HTML/encode_html_entities.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/HTML/html_completions.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/Package Control/Package Control.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/Pandown/minify_json.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/Pandown/pandownBuildCommand.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/Pandown/pandownCriticPreprocessor.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/Pandown/pandownProcess.py
    Traceback (most recent call last):
      File "./sublime_plugin.py", line 62, in reload_plugin
      File "./pandownProcess.py", line 270
        proc), 0)
                ^
    IndentationError: unindent does not match any outer indentation level
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/Pandown/pandownTouchProjectConfigCommand.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/Placehold.it Image Tag Generator/Placeholdit.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/SCSS/scss_completions.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/StringEncode/string_encode.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/SublimeOnSaveBuild/SublimeOnSaveBuild.py
    Reloading plugin /Users/Dan/Library/Application Support/Sublime Text 2/Packages/TrailingSpaces/trailing_spaces.py
    plugin init time: 0.200766

Cheers,
Dan

@phyllisstein
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh how bizarre. Either I or Git---probably I---created a weird typo at the bottom of pandownProcess.py during the last commit. I just pushed an update that should propagate through Package Control shortly. Thanks for the heads-up!

@dotherightthing
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How bizarre, how bizarre. Cheers for the fix - working beautifully now thanks :)

Please sign in to comment.