lithium3

Check-in [b384211877]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:natools-web-simple_pages-markdown_multipages: add page template support
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b3842118772679d44c21905c9f5be9b0e768340f
User & Date: nat 2019-04-28 17:24:35
Context
2019-05-05
16:57
lithium-dispatchers: add the dynamic multipage constructor check-in: e4a4a7ffda user: nat tags: trunk
2019-04-28
17:24
natools-web-simple_pages-markdown_multipages: add page template support check-in: b384211877 user: nat tags: trunk
2019-03-31
21:57
lithium-dispatchers: add the cookie setter page constructor check-in: 472ca5879e user: nat tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/natools-web-simple_pages-markdown_multipages.adb.

179
180
181
182
183
184
185

186
187
188


189
190
191
192
193

194





195

196
197







198
199
200
201
202
203
204
      Parser : Lithium.Line_Parsers.Parser (Stream'Access);
      Lock : S_Expressions.Lockable.Lock_State;
      Text : S_Expressions.Atom_Refs.Immutable_Reference;
      Summary : S_Expressions.Atom_Refs.Immutable_Reference;
      Line, Markdown : S_Expressions.Atom_Buffers.Atom_Buffer;
      Event : S_Expressions.Events.Event;
      Finished : Boolean;

   begin
      Read_Pages :
      loop


         Parser.Next (Event);
         exit Read_Pages when Event /= S_Expressions.Events.Open_List;
         Parser.Lock (Lock);
         Parser.Next (Event);
         exit Read_Pages when Event /= S_Expressions.Events.Add_Atom;







         declare

            Path_Spec : constant S_Expressions.Atom := Parser.Current_Atom;
            Page : constant Page_Ref := Create (Parser);







         begin
            Markdown.Soft_Reset;
            Read_Markdown :
            loop
               Line.Soft_Reset;
               Lithium.Line_Parsers.Append_Line (Line, Stream, Finished);








>



>
>
|
|
|
|
|
>

>
>
>
>
>

>

|
>
>
>
>
>
>
>







179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
      Parser : Lithium.Line_Parsers.Parser (Stream'Access);
      Lock : S_Expressions.Lockable.Lock_State;
      Text : S_Expressions.Atom_Refs.Immutable_Reference;
      Summary : S_Expressions.Atom_Refs.Immutable_Reference;
      Line, Markdown : S_Expressions.Atom_Buffers.Atom_Buffer;
      Event : S_Expressions.Events.Event;
      Finished : Boolean;
      Template : Page_Template;
   begin
      Read_Pages :
      loop
         Skip_To_Next_Page :
         loop
            Parser.Next (Event);
            exit Read_Pages when Event /= S_Expressions.Events.Open_List;
            Parser.Lock (Lock);
            Parser.Next (Event);
            exit Read_Pages when Event /= S_Expressions.Events.Add_Atom;
            exit Skip_To_Next_Page when Parser.Current_Atom'Length > 0;

            --  Read templae
            Update (Template, Parser);
            Parser.Unlock (Lock);
         end loop Skip_To_Next_Page;

         declare
            use type S_Expressions.Offset;
            Path_Spec : constant S_Expressions.Atom := Parser.Current_Atom;
            Page : constant Page_Ref := Create
              (Parser,
               Template,
               (if Path_Spec (Path_Spec'First) in Character'Pos ('#')
                                                | Character'Pos ('+')
                                                | Character'Pos ('-')
                then Path_Spec (Path_Spec'First + 1 .. Path_Spec'Last)
                else Path_Spec));
         begin
            Markdown.Soft_Reset;
            Read_Markdown :
            loop
               Line.Soft_Reset;
               Lithium.Line_Parsers.Append_Line (Line, Stream, Finished);