@@ -234,10 +234,9 @@ writeRecord(
234
234
RecordInfo const & I)
235
235
{
236
236
openSection (I.Name );
237
- if (auto brief = I.javadoc .getBrief ())
238
- {
239
- // print it
240
- }
237
+
238
+ // Brief
239
+ writeBrief (I.javadoc .getBrief ());
241
240
242
241
// Synopsis
243
242
openSection (" Synopsis" );
@@ -262,13 +261,8 @@ writeRecord(
262
261
" ----\n " ;
263
262
closeSection ();
264
263
265
- // if(! I.javadoc.desc.empty())
266
- {
267
- os_ << " \n " ;
268
- openSection (" Description" );
269
- // os_ << I.javadoc.desc << "\n";
270
- closeSection ();
271
- }
264
+ // Description
265
+ writeDescription (I.javadoc .getBlocks ());
272
266
273
267
writeMemberTypes (
274
268
" Data Members" ,
@@ -318,8 +312,11 @@ Writer::
318
312
writeFunction (
319
313
FunctionInfo const & I)
320
314
{
315
+ return ;
321
316
openSection (I.Name );
322
- // os_ << I.javadoc.brief << "\n\n";
317
+
318
+ // Brief
319
+ writeBrief (I.javadoc .getBrief ());
323
320
324
321
// Synopsis
325
322
openSection (" Synopsis" );
@@ -329,6 +326,9 @@ writeFunction(
329
326
" [,cpp]\n "
330
327
" ----\n " ;
331
328
329
+ // Description
330
+ writeDescription (I.javadoc .getBlocks ());
331
+
332
332
// params
333
333
if (! I.Params .empty ())
334
334
{
@@ -371,6 +371,16 @@ Writer::
371
371
writeEnum (
372
372
EnumInfo const & I)
373
373
{
374
+ return ;
375
+ openSection (I.Name );
376
+
377
+ // Brief
378
+ writeBrief (I.javadoc .getBrief ());
379
+
380
+ // Description
381
+ writeDescription (I.javadoc .getBlocks ());
382
+
383
+ closeSection ();
374
384
}
375
385
376
386
void
@@ -379,6 +389,16 @@ Writer::
379
389
writeTypedef (
380
390
TypedefInfo const & I)
381
391
{
392
+ return ;
393
+ openSection (I.Name );
394
+
395
+ // Brief
396
+ writeBrief (I.javadoc .getBrief ());
397
+
398
+ // Description
399
+ writeDescription (I.javadoc .getBlocks ());
400
+
401
+ closeSection ();
382
402
}
383
403
384
404
// ------------------------------------------------
@@ -478,6 +498,181 @@ writeMemberTypes(
478
498
479
499
// ------------------------------------------------
480
500
501
+ void
502
+ AsciidocGenerator::
503
+ Writer::
504
+ writeBrief (
505
+ Javadoc::Paragraph const * node)
506
+ {
507
+ if (! node)
508
+ return ;
509
+ if (node->empty ())
510
+ return ;
511
+ writeNode (*node);
512
+ }
513
+
514
+ void
515
+ AsciidocGenerator::
516
+ Writer::
517
+ writeDescription (
518
+ List<Javadoc::Block> const & list)
519
+ {
520
+ if (list.empty ())
521
+ return ;
522
+ os_ << " \n " ;
523
+ openSection (" Description" );
524
+ writeNodes (list);
525
+ closeSection ();
526
+ }
527
+
528
+ // ------------------------------------------------
529
+
530
+ template <class T >
531
+ void
532
+ AsciidocGenerator::
533
+ Writer::
534
+ writeNodes (
535
+ List<T> const & list)
536
+ {
537
+ if (list.empty ())
538
+ return ;
539
+ for (auto const & node : list)
540
+ writeNode (node);
541
+ }
542
+
543
+ void
544
+ AsciidocGenerator::
545
+ Writer::
546
+ writeNode (
547
+ Javadoc::Node const & node)
548
+ {
549
+ switch (node.kind )
550
+ {
551
+ case Javadoc::Kind::text:
552
+ writeNode (static_cast <Javadoc::Text const &>(node));
553
+ return ;
554
+ case Javadoc::Kind::styled:
555
+ writeNode (static_cast <Javadoc::StyledText const &>(node));
556
+ return ;
557
+ #if 0
558
+ case Javadoc::Node::block:
559
+ writeNode(static_cast<Javadoc::Block const&>(node));
560
+ return;
561
+ #endif
562
+ case Javadoc::Kind::brief:
563
+ case Javadoc::Kind::paragraph:
564
+ writeNode (static_cast <Javadoc::Paragraph const &>(node));
565
+ return ;
566
+ case Javadoc::Kind::admonition:
567
+ writeNode (static_cast <Javadoc::Admonition const &>(node));
568
+ return ;
569
+ case Javadoc::Kind::code:
570
+ writeNode (static_cast <Javadoc::Code const &>(node));
571
+ return ;
572
+ case Javadoc::Kind::param:
573
+ writeNode (static_cast <Javadoc::Param const &>(node));
574
+ return ;
575
+ case Javadoc::Kind::tparam:
576
+ writeNode (static_cast <Javadoc::TParam const &>(node));
577
+ return ;
578
+ case Javadoc::Kind::returns:
579
+ writeNode (static_cast <Javadoc::Returns const &>(node));
580
+ return ;
581
+ default :
582
+ llvm_unreachable (" unknown kind" );
583
+ }
584
+ }
585
+
586
+ void
587
+ AsciidocGenerator::
588
+ Writer::
589
+ writeNode (
590
+ Javadoc::Text const & node)
591
+ {
592
+ os_ << node.text << ' \n ' ;
593
+ }
594
+
595
+ void
596
+ AsciidocGenerator::
597
+ Writer::
598
+ writeNode (
599
+ Javadoc::StyledText const & node)
600
+ {
601
+ switch (node.style )
602
+ {
603
+ case Javadoc::Style ::bold :
604
+ os_ << ' *' << node.text << ' *' ;
605
+ break ;
606
+ case Javadoc::Style ::mono:
607
+ os_ << ' `' << node.text << ' `' ;
608
+ break ;
609
+ case Javadoc::Style ::italic :
610
+ os_ << ' _' << node.text << ' _' ;
611
+ break ;
612
+ default :
613
+ os_ << node.text ;
614
+ break ;
615
+ }
616
+ }
617
+
618
+ void
619
+ AsciidocGenerator::
620
+ Writer::
621
+ writeNode (
622
+ Javadoc::Paragraph const & node)
623
+ {
624
+ writeNodes (node.list );
625
+ }
626
+
627
+ void
628
+ AsciidocGenerator::
629
+ Writer::
630
+ writeNode (
631
+ Javadoc::Admonition const & node)
632
+ {
633
+ writeNodes (node.list );
634
+ }
635
+
636
+ void
637
+ AsciidocGenerator::
638
+ Writer::
639
+ writeNode (
640
+ Javadoc::Code const & node)
641
+ {
642
+ os_ <<
643
+ " [,cpp]\n "
644
+ " ----\n " ;
645
+ writeNodes (node.list );
646
+ os_ <<
647
+ " ----\n " ;
648
+ }
649
+
650
+ void
651
+ AsciidocGenerator::
652
+ Writer::
653
+ writeNode (
654
+ Javadoc::Param const & node)
655
+ {
656
+ }
657
+
658
+ void
659
+ AsciidocGenerator::
660
+ Writer::
661
+ writeNode (
662
+ Javadoc::TParam const & node)
663
+ {
664
+ }
665
+
666
+ void
667
+ AsciidocGenerator::
668
+ Writer::
669
+ writeNode (
670
+ Javadoc::Returns const & node)
671
+ {
672
+ }
673
+
674
+ // ------------------------------------------------
675
+
481
676
void
482
677
AsciidocGenerator::
483
678
Writer::
0 commit comments