Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline amk  
#1 Posted : 03 July 2012 19:54:58(UTC)
amk

Rank: Newbie

Groups: Registered
Joined: 03/07/2012(UTC)
Posts: 4
United States

Was thanked: 1 time(s) in 1 post(s)
Hi,

I've been using SMath for a few projects that I am going to share with other people. For simple review (no editing) HTML output seems to be the way to go.

However, the markup right now is a bit messy and hard to edit. The best solution is to use a CSS header instead of specifying style information in each HTML tag. For example, adding a few pixels of padding to the span element makes text with boxes appear more like it does in the original .sm file. Defining the font in the header would also let the user quickly change the appearance of their document.

Example:

Quote:
<style type="text/css" media="all">
span {padding: 3px; font-family: Arial,Helvetica,sans-serif; color: #000000; background-color: #ffffff;}
</style>


A more advanced approach would be to specify a few classes, like "boxed", that would let the user change the default border color for boxed elements, etc. A little Java script could easily add support for collapsing/uncollapsing Areas, which would be awesome for an HTML document.


It would be great if this approach could be taken in a future version. Thanks for making this awesome tool!

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline kilele  
#2 Posted : 05 July 2012 09:15:42(UTC)
kilele


Rank: Advanced Member

Groups: Registered
Joined: 30/03/2011(UTC)
Posts: 393

Was thanked: 132 time(s) in 113 post(s)
Originally Posted by: amk Go to Quoted Post
A little Java script could easily add support for collapsing/uncollapsing Areas, which would be awesome for an HTML document.


somethink like this ? it's the best script I was able to find as for browsers compatibility
http://www.dynamicdrive....amicindex1/navigate2.htm

Offline amk  
#3 Posted : 05 July 2012 20:09:47(UTC)
amk

Rank: Newbie

Groups: Registered
Joined: 03/07/2012(UTC)
Posts: 4
United States

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: kilele Go to Quoted Post
Originally Posted by: amk Go to Quoted Post
A little Java script could easily add support for collapsing/uncollapsing Areas, which would be awesome for an HTML document.


somethink like this ? it's the best script I was able to find as for browsers compatibility
http://www.dynamicdrive....amicindex1/navigate2.htm



I don't think it's necessary to save the collapsed state or anything like that. Two very simple JavaScripts could be written that show/hide specific elements:

Code:

   <!--
	function show(x) {
		document.getElementById(x).style.display = "block";
		}
		
	function hide(x) {
		document.getElementById(x).style.display = "none";
		}
   // -->


Code:
<a onclick="show('area1')">Show</a> | <a onclick="hide('area1')">Hide</a> <hr /><br />
	<div id="area1">
   		<div>stuff that can be toggled on/off</div>
	</div>
<a onclick="show('area2')">Show</a> | <a onclick="hide('area2')">Hide</a> <hr /><br />
	<div id="area2">
   		<div><span>some text that you want to hide<span></div>
	</div>


I didn't include the position information, but that could be pulled from the area toggle in the .sm file, I assume. Also, both buttons are always visible but that could be changed.


EDIT: Actually, there is a problem. Using absolute positions in the document means that the Areas don't collapse, but rather just turn blank. A workaround might be to specify the pixel height of the Area elements, relative-position them, then subtract the initial position from absolute y-values of the elements inside the Area. I don't think is such a quick fix any more, unfortunately.




9/3/2012

I attached a modified .cs file from the SVN repo. Made a few minor changes that clean up the output a little and made it so font changes carry through the whole document; if someone could look over it and then make a commit if they are comfortable with it, that would be great.

Edited by user 04 September 2012 08:31:43(UTC)  | Reason: Not specified

File Attachment(s):
SavePageToHTML.zip (2kb) downloaded 16 time(s).
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.