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 
Send Topic Print
Export set up for logical efficient learning curve (Read 8211 times)
Dr Mark
Full Member
*
Offline



Posts: 26

Export set up for logical efficient learning curve
Jul 10th, 2014, 5:04pm
 
I'm enjoying TB6 and having read the TB Way, and with a (distant) background in coding am comfortable with Agents, Aliases, Adornments, rules, iteration and recursion etc... and get the not-rushing to emergent themes and links

However - Could the Marks and others suggest a sequence of small TB tasks that build skills in developing the ability to eventually export a series of files - Perhaps suggesting what local set up they have on their Macs to check it all works

Does anyone have a well documented TBX6 file that they use to export say to a website/weblog that I could inspect

Cheers
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #1 - Jul 10th, 2014, 5:14pm
 
Try the files here for some basic building blocks. The documentation in the v5 aTbRef is still pertinent to action/export code function.
Back to top
 
 

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #2 - Jul 13th, 2014, 5:43pm
 
Thank you Mark

I have been playing around simply trying to export a series of web pages following the logic within the cookbook of using templates/prototype combinations to assign and include nav elements, footers, stylesheets and am getting on well - However when I export the style sheet using a .css extension I get lots of added <p> tags which render the stylesheet useless
Any ideas?


<p>body {</p>
   <p>font: 100% Verdana;</p></p>
   <p>margin: 20px;</p></p>
   <p>line-height: 26px;</p></p>
<p>}</p>


<p>h1, h2, h3 {</p>
   <p>color: #84c754;</p></p>
<p>}</p>


<p>a {</p>
   <p>color: #000000;</p>
<p>}</p>

Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #3 - Jul 13th, 2014, 6:12pm
 
By default, TB's HTML Export exports HTML. The app has no way to know you want export something else, e.g. plain unformatted $Text, unless you tell it to. Thus, if you want a note to export plain text, use ^value($Text)^, instead of ^text^.

^text^ exports $Text marked up for HTML. In earlier examples you may see ^text(plain)^ used but this is now deprecated for the ^value()^ syntax.

If you are using a note to write pure code, I'd also suggest adding the 'Code' built-in prototype to your doc and applying that to notes that will hold code before you add any text (tip: use a container whose $OnAdd sets the prototype to new children). The prototype turns off a number affordances for the convenience of normal writing like smart lists, etc, but which are inappropriate for writing code.
Back to top
 
« Last Edit: Jul 13th, 2014, 6:16pm by Mark Anderson »  

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #4 - Jul 13th, 2014, 7:09pm
 
Thanks Mark - I will look into that - I deleted the contents of the Markup boxes ( tab 6 inspector) which worked - inelegant so grateful for your advice

Where I'm struggling a bit is with the path to the ccs file and the use of ^root^ -

I have a series of blog posts
Blog 1
Blog 2
Blog 3

and an agent that picks out the blogs with certain words

alias_Blog1
alias_Blog3


These aliases are nested deeper than the originals

I use an ^include(CSS_Styles) in the template for blog where

CCS_Styles is

<link rel="stylesheet" href="styles.css" type="text/css"  />

It means the alisases don't get to see the right location

I'm sure ^root^ is needed but not sure where to put it!
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #5 - Jul 14th, 2014, 3:40am
 
I suggest the following.  The reason I use a container (exported folder) for the CSS file is incase the project grows and you extra CSS, then you don't get loads of files cluttering the root of your website. Here's the process:
  • Make a root level container 'css'. Place your CSS note inside the container.
  • Select the container and open the HTML Inspector.
  • Untick 'Export', but leave 'Export Children' ticked. This means the container will export a folder for the CSS note's export but won't export itself as a file (as the container has no content).
  • If you want to call the container something else, then in the HTML inspector set the filename box to 'css' - this sets the name of the exported folder.
  • Leave the CSS note export settings as at present.
  • In your main export templates, the CSS reference link becomes this (path in blue):
    <link rel="stylesheet" href="^root^css/styles.css" type="text/css"  />
  • Alias export is smart enough to figure a different relative path to for ^root^ compared to the original.
If you've scripts (e.g. JavaScript) I suggest using a separate root level 'scripts' or 'js' container and applying the same ^root^ method for relative paths.

More on ^root^.
Back to top
 
 

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #6 - Jul 14th, 2014, 1:30pm
 
Thanks Mark - that has worked for me. Currently learning a lot by my mistakes but climbing the curve - thanks for the leg up
Back to top
 
 
  IP Logged
Dr Mark
Full Member
*
Offline



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #7 - Jul 14th, 2014, 2:17pm
 
I want to include a note which contains navigation information

I have ^include(nav) in the template

nav contains ^childLink()^ and uses an export template ^text

Doesn't work?

If I bypass the nav note and simply put ^childLink()^ in the template it works and creates normal linking html in the notes that use it

The other way just puts the literal ^childLink()^ in the note

I'm guessing that when a note uses a template and html is created the include command simply add the contents of the included file but that any command the text might imply (like ancestors() or childLink()...) is not actually implemented at that stage?

If so I'll have to put such commands in the template

Have I got that right?



Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #8 - Jul 14th, 2014, 2:43pm
 
There is no ^childLink^ code - it is ^childLinks^ with an 's'. Try fixing that before looking further.
Back to top
 
 

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #9 - Jul 14th, 2014, 3:01pm
 
Yes I've used childLinks everywhere - so that's not the issue
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #10 - Jul 14th, 2014, 3:55pm
 
The scenario as you describe 2 posts back works for me, so there's some missing info. Can you post a link to copy of your problem file so we can see what might be missing?
Back to top
 
 

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #11 - Jul 14th, 2014, 5:26pm
 
Not sure how I attach a file here?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #12 - Jul 15th, 2014, 2:53am
 
Not here (the forum doesn't accept attachments), put in your own webspace or a file service or a share a Dropbox link, etc.
Back to top
 
 

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



Posts: 26

Re: Export set up for logical efficient learning curve
Reply #13 - Jul 16th, 2014, 4:13am
 
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Export set up for logical efficient learning curve
Reply #14 - Jul 16th, 2014, 7:46am
 
Found the problem. You've made your boilerplate CSS note a template when what you really want is the export-evaluated contents of the note. Templates don't evaluate themselves - rather they tell TB how other notes are to be processed for export.

To make things work, remove the prototype assignment from CSS_styles and set that note's export template to 'text only'.
Back to top
 
 

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