Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> CSS : where am I going wrong
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1425653612

Message started by Dr Mark on Mar 6th, 2015, 9:53am

Title: CSS : where am I going wrong
Post by Dr Mark on Mar 6th, 2015, 9:53am

Hi

https://www.dropbox.com/s/uttf2gmmv4vkmig/CSS_Trial.tbx?dl=0

I'd be very grateful if someone could spot why this very simple TBX file doesn't produce the desired CSS include changes

The frustration is that I had a more complicated set up working fine with a tbx6 file a year ago ( but haven't kept it)

I'm using TBX a lot at present to construct a weekly Newsletter. I keep agenda/minutes from different types of meetings and tasks arising and add a Newletter boolean attribute if I want my ag_current_newsletter agent to pick it out

The agent is set to a template that produces a good simple HTML output and I'm pleased with the automation - However I would like to start using CSS to make the output more aesthetically pleasing and so created a simple file to prove I could do it - and I can't!

many thanks in advance

Mark



Title: Re: CSS : where am I going wrong
Post by Mark Anderson on Mar 6th, 2015, 10:15am

You're using ^text^ to export the CSS. As such it is adding HTML to the 'paragraphs' in the CSS note. The folowing answer is tested in v6.1.3…

I suggest adding the build-in "Code" prototype. Duplicate that and call it "Web Code". In the HTML Inspector set the prototype to export ("Code" is set to not export).

Now set your CSS note to use the "Web Code" prototype. For good measure I'd select all the CSS note's Text and Use the Format menu -> Style -> Standard Size and Standard Font to reset defaults.

To 'preview' your CSS use just the HTML tab.

Whilst you could just use ^value($Text)^ instead of the original ^text^ template, the prototype turns off all sort of prose-writing formatting that will like as not break your code with incorrect substitutions.

Title: Re: CSS : where am I going wrong
Post by Dr Mark on Mar 6th, 2015, 10:46am

Wonderful - thank you so much

Title: Re: CSS : where am I going wrong
Post by Dr Mark on Mar 6th, 2015, 7:46pm


Quote:
To 'preview' your CSS use just the HTML tab.


Does this mean that preview won't render the css changes? Do I have to export and view in a browser to see the results? (Preview is still not reflecting the changes for me after following the above)

Title: Re: CSS : where am I going wrong
Post by Mark Anderson on Mar 7th, 2015, 12:45pm

Sorry, I thought the problem was the CSS wasn't exporting properly. OK, you've a host of small mis-configurations. I suspect this was finger trouble setting up the sample doc as I doubt it would work any different in older version, as pesented.  :)  Anyway:
  • You have un-set template setting for the "HTML Page" template making it unavailable use.
  • The text export page is using 'HTML Item' as a template (probably because of the above) whereas it should be 'HTML Page'.
  • The test page is incorrectly set to use the 'HTML Template'
  • You are assuming note titles export in actual case. They don't, all characters export lower case and space (plus any non-HTML safe characters) are rendered as underscores. Thus container 'CSS' exports a folder 'css'.
  • You css file exports as styles.css.html. I'd change the $Name to 'styles' and then in HTML Inspector for the note set the export extension to '.css'. TB has no way to guess we extension the user intends.
  • I'd amend your CSS link the HTML Page's <head> section to : <link rel="stylesheet" href="^url("styles")^" type="text/css">
Fix all that, export the doc and then the HTML text page does render. I think TB uses the exported CSS to render the in-doc Preview as if you delete the exported files the Preview isn't styled.

I hope that makes sense.

Title: Re: CSS : where am I going wrong
Post by Dr Mark on Mar 8th, 2015, 1:02pm


Quote:
I hope that makes sense.


Not entirely but exactly the right balance of spoon-feeding and student stretching :)

It has worked and I'm very grateful. The preview in tinderbox is working too and stops if the file is removed which is your experience too it seems

Once again any thanks

ps is ^root^ deprecated now in favour of ^url^

Title: Re: CSS : where am I going wrong
Post by Mark Anderson on Mar 8th, 2015, 4:08pm

Good! 'Ease' of use ("I just…") since in awkward counterpoint to flexibility. WE tend to start with none and wanting lots. If still in doubt, do ask. Everything should be explainable!

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.