Notes: Difference between revisions

From Hackspire
Jump to navigation Jump to search
Line 52: Line 52:
Several types of words: 1word : normal // 1keyword : bold // 1subhead : italic // 1title : underline // 1subscrp : subscript // 1supersc : superscript . Thus, you can't have a bold underline word.
Several types of words: 1word : normal // 1keyword : bold // 1subhead : italic // 1title : underline // 1subscrp : subscript // 1supersc : superscript . Thus, you can't have a bold underline word.
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<leaf name="1{typeofword}">{text}</leaf> <!-- There should be a leaf per word, but maybe you can bypass it and put a word per line -->
<leaf name="1{typeofword}">{text}</leaf> <!-- There should be a leaf per word, but you can put several word in a leaf (using regular spaces) -->
</syntaxhighlight>
</syntaxhighlight>



Revision as of 15:09, 2 January 2012

Notes Meta-data

Raw

<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0">
<np:mFlags>1024</np:mFlags>
<np:value>3</np:value>
<np:fmtxt>{TREE}</np:fmtxt>
</wdgt>

Explanation

<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0">	<!--  -->
<np:mFlags>1024</np:mFlags>					<!--  -->
<np:value>3</np:value>						<!--  -->
<np:fmtxt>{TREE}</np:fmtxt>					<!-- Text is in this tree -->
</wdgt>								<!--  -->


Notes Text-tree

Text is stored in a tree beginning by <r2dtotree> and ending by </r2dtotree>.

Al < , > , " , ect... should be written as < ... Here they are transformed so you can read easily.


Doc

<node name="1doc">{paragraphs}</node> <!-- I could not find a way to have several of these in the tree. -->


Paragraph

<node name="1para">{lines}</node> <!-- New paragraph each time you're forcing a new line (pressing "enter") -->


Line

<node name="1rtline">{words}</node> <!-- New line when it makes a new line due to screen size not being infinite. Not sure if you must put several of them because it depends on font size. -->


Word

Several types of words: 1word : normal // 1keyword : bold // 1subhead : italic // 1title : underline // 1subscrp : subscript // 1supersc : superscript . Thus, you can't have a bold underline word.

<leaf name="1{typeofword}">{text}</leaf> <!-- There should be a leaf per word, but you can put several word in a leaf (using regular spaces) -->

Raw exemple

<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0">
	<np:mFlags>1024</np:mFlags>
	<np:value>3</np:value>
	<np:fmtxt>
		<r2dtotree>
			<node name="1doc">
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							L1
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							L2
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							L3
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word" continued="1">
							llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
						</leaf>
					</node>
					<node name="1rtline">
						<leaf name="1word" continuation="1">
							llllllllllllllllllllllllllllllllllllllllllllllllllllllll
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							&amp;amp;é&amp;quot;&amp;apos;(-è_çà)=
						</leaf>
					</node>
				</node>
				
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word"/>
					</node>
				</node>
					
				<node name="1para">
					<node name="1rtline">
						<leaf name="1word">
							L10!
						<cursor index="0"/>
						</leaf>
						</node>
				</node>
				
			</node>
		</r2dtotree>
	</np:fmtxt>
</wdgt>

<!-- Another example (now properly indented) -->

<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0">
 <np:mFlags>1024</np:mFlags>
 <np:value>3</np:value>
 <np:fmtxt>
     <r2dtotree>
         <node name="1doc">
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L1normal</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L2</leaf>
                     <leaf name="1keyword">gras</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L3</leaf>
                     <leaf name="1subhead">italique</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1subhead">L4</leaf>
                     <leaf name="1word">blabla</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1title">L5</leaf>
                     <leaf name="1title">souligné</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L6</leaf>
                     <leaf name="1supersc">up</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L7</leaf>
                     <leaf name="1subscrp">down</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">L8</leaf>
                     <leaf name="1word">on</leaf>
                     <leaf name="1title">mixxe|xx|</leaf>
                     <leaf name="1keyword">
                         <cursor index="0"/>eeee</leaf>
                     <leaf name="1keyword">==></leaf>
                     <leaf name="1keyword">fail</leaf>
                 </node>
             </node>
             <node name="1para">
                 <node name="1rtline">
                     <leaf name="1word">Et</leaf>
                     <leaf name="1word">ci</leaf>
                     <leaf name="1word">on</leaf>
                     <leaf name="1word">fait</leaf>
                     <leaf name="1word">ça?:</leaf>
                     <leaf name="1word"></leaf>
                     <leaf name="1keyword">11</leaf>
                     <leaf name="1title">22</leaf>
                     <leaf name="1keyword">11</leaf>
                 </node>
             </node>
         </node>
     </r2dtotree>
 </np:fmtxt>
</wdgt>


Catégorie:XML format used in TNS&TNSP files