Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1 2 3 
Send Topic Print
Using CSS in template (Read 26328 times)
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using CSS in template
Reply #30 - Dec 18th, 2010, 4:19am
 
Your file is actually at:
http://public.me.com/greiggy/Public/Tinderbox_Article_Format_3.tbx

The partial output is simply because the result of ^value(runCommand... is nothing, i.e. no text - processed or otherwise.

I don't have the Multimarkdown.pl but I think I see the error. Your note holds the path but not the full command. Remember, the command line is:

Perl path-to-script

Currently your "MultiMarkdown" note's text is:

path-to-script

Add the word 'Perl' and a space before the path in $Text of note "MultiMarkdown" so it looks like this:

Perl greiggy/Library/MultiMarkdown/MultiMarkdown.pl

The next issue is I'm not sure that's a valid path, in CL terms. Assuming 'greiggy' is the (short) OS name of your home folder, I'd use either:

Perl /Users/greiggy/Library/MultiMarkdown/MultiMarkdown.pl
or
Perl ~/Library/MultiMarkdown/MultiMarkdown.pl

I think the latter is more useful as it will work on any user's account - e.g. other people using/testing the TBX. AEither way, I can't test that here as I don't have 'MultiMarkdown.pl' but experience thus indicates the latter $Text above should work.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Ian Greig
Full Member
*
Offline



Posts: 74
Wokingham, UK
Re: Using CSS in template
Reply #31 - Dec 18th, 2010, 4:44am
 
I have previously tried that string with and without "Perl" at the front (Mark B posted a comment that seemed to say that without was more correct, which is why I have tried it both ways).

Thanks for those two paths, the /Users.... and the -/Library.... one.

I have tried both paths. Both seems to work exactly the same in terms of the MultiMarkdown (some evidence of structure).

However, I still only get a title page with TOC anchor links. And the links don't work (would expect document to flow on, visible below, in any case).

Should we investigate other settings e.g. Tinderbox templates?

Back to top
 
« Last Edit: Dec 18th, 2010, 4:46am by Ian Greig »  

--IanG
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using CSS in template
Reply #32 - Dec 18th, 2010, 5:17am
 
I've sent further details via email (as they're lengthy). To help us help you, I suggest use Markdown.pl in our home folder as the configuration, with a note called "Markdown" having this text

Perl ~/Markdown.pl

When that works, if necessary we can tackle issue of using a diferent Perl script/location. Otherwise we inadvertently introduce more variables and scope for new errors.

I've replied to you email.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Ian Greig
Full Member
*
Offline



Posts: 74
Wokingham, UK
Re: Using CSS in template
Reply #33 - Dec 19th, 2010, 3:20pm
 
I can get the Markdown.pl script to work fine IF it is in a folder at root level.

If I move it one folder up e.g. within -/Library I get the reduced output.

The MultiMarkdown.pl script doesn't want to play, even at root level.
Back to top
 
 

--IanG
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using CSS in template
Reply #34 - Dec 19th, 2010, 4:22pm
 
'-/Library' isn't a valid path. '/Library/' and '~/Library/ are (latter, in your case, is a short form of '/Users/greiggy/Library/').

To ensure you're using the correct path, try this. Locate your script in Finder. Open Terminal then drag the script folder onto the Terminal window. Terminal will report the correct POSIX (Unix-style) path; you'll notice that any spaces in the path will be escaped with a backslash.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Ian Greig
Full Member
*
Offline



Posts: 74
Wokingham, UK
Re: Using CSS in template
Reply #35 - Dec 19th, 2010, 6:03pm
 
Now using (tilde) ~/Library/Markdown/Markdown.pl.

It works fine and this looks like a sensible path.

For some reason, I cannot get the (similar) MultiMarkdown.pl script to run but I do not at this time need the extra formats MultiMarkdown proves.

What I have learned from this, for the benefit of others:

1. Markdown.pl works well with CSS in Tinderbox.

2. It is fiddly to set up, but this model can serve as a starter.

3. The command lines are extremely sensitive and a folder with two words e.g. Application Support, widely used for other scripts, will crash this one. The space between the words can be escaped by using a backslash e.g. Application\ Support, but probably better to create another folder without a space.

4. Conventional Mac paths are best

5. Getting to grips with TB sometimes seems akin to the start-up procedure of a pre World War Two aircraft, with a huge number of steps and then you still have to swing the prop and hope, however fortunately there are knowledgeable, patient and helpful people out there to walk you through it thanks especially to Mark A.

Just to clarify: the path won't crash. At least, no one said anything about crashes. The path won't work if you don't specify the correct path, of course; that's the way Mac OS X works. I also deeply disagree with the characterization above; how many programs are there -- in ANY operating system -- that support replacing the program's text markup with a completely new text markup?  It's remarkable that this is possible at all, and unsurprising that it's difficult. -- MB
Back to top
 
« Last Edit: Dec 19th, 2010, 10:02pm by Mark Bernstein »  

--IanG
  IP Logged
Ian Greig
Full Member
*
Offline



Posts: 74
Wokingham, UK
Re: Using CSS in template
Reply #36 - Dec 19th, 2010, 6:11pm
 
I have corrected the model job
http://public.me.com/greiggy/Public/Tinderbox_Article_Format_3.tbx

You will need to create a folder called "Markdown" in your home folder, and download the Markdown.pl script and place it in this folder -- then it should work.
Back to top
 
 

--IanG
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using CSS in template
Reply #37 - Dec 20th, 2010, 4:42am
 
The valuable learning point here for later readers of this thread is that whilst TB allows the user to access the OS' command line (i.e. its Unix shell), the has assumes the user has some understanding of the process that their using outside TB.

Burrowing into Markdown's docs it seems does have a couple of command line switches which mean there's a simple test the user can run. Place the script in your OS account's home folder. Open Terminal on your Mac. Type this at the prompt and then hit the Return key:

~/Markdown.pl --v

If your Markdown script is in the correct location and has correct permissions and the script is not not corrupt in any way, the text of the note will become:

This is Markdown, version 1.0.1.
Copyright 2004 John Gruber
http://daringfireball.net/projects/markdown/


If there's no text, the issue is one or more of: corrupted script, script in wrong location, wrong permissions on script file. If it works, make a note in TB with this $Rule:

$Text = runCommand(~/Markdown.pl --v)

The text should now be the above version text. If not, you know you've made an error in the CL syntax you've used in the runCommand() statement.

Much of the confusion in the above thread could have been avoided had this test been run before trying to test from TB, and repeating the test each time the target script was moved - or substituted for a different script. Knowing the script behaves in the shell, without TB involvement, saves a lot (see above!) of chasing the wrong fault in the wrong place. Conversely, if you know the script is correct it's easier to zero in on the likely place in TB where code might not be set correctly.

I've added a number of pointers, up-thread, to this post as I think early testing of paths in Terminal will help resolve a lot of issue for users with a similar problem.

Having found the MultiMarkdown project, picking through the rather scant documentation it's likely the earlier problems with MMD (as opposed to MD) were due to the MMD file set (a whole bunch of scripts, etc.) weren't properly installed outside TB.

~~~~~~~~
For general use by any TB user - rather than experienced coders, I think a version of Les' tutorial with instructions on how to install/test MD in the shell would be useful. I think it would also be useful to give an MD install location within the users own folders, rather than make them at to root-own files in /usr/.
Back to top
 
« Last Edit: Dec 20th, 2010, 5:30am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1 2 3 
Send Topic Print