|
@@ -12,7 +12,9 @@ Class DocsMaker
|
|
_nav=New JsonBuffer
|
|
_nav=New JsonBuffer
|
|
|
|
|
|
_md=New MarkdownBuffer( "",Lambda:String( link:String,name:String )
|
|
_md=New MarkdownBuffer( "",Lambda:String( link:String,name:String )
|
|
|
|
+
|
|
Return ResolveLink( link,name,_linkScope )
|
|
Return ResolveLink( link,name,_linkScope )
|
|
|
|
+
|
|
End )
|
|
End )
|
|
End
|
|
End
|
|
|
|
|
|
@@ -25,7 +27,9 @@ Class DocsMaker
|
|
CreateDir( module.baseDir+"docs/__MANPAGES__" )
|
|
CreateDir( module.baseDir+"docs/__MANPAGES__" )
|
|
|
|
|
|
Local pages:=ManPage.MakeManPages( path,module,Lambda:String( link:String,name:String )
|
|
Local pages:=ManPage.MakeManPages( path,module,Lambda:String( link:String,name:String )
|
|
|
|
+
|
|
Return ResolveLink( link,name,_linkScope )
|
|
Return ResolveLink( link,name,_linkScope )
|
|
|
|
+
|
|
End )
|
|
End )
|
|
|
|
|
|
For Local it:=Eachin pages
|
|
For Local it:=Eachin pages
|
|
@@ -33,6 +37,8 @@ Class DocsMaker
|
|
Local path:=it.Key 'source path
|
|
Local path:=it.Key 'source path
|
|
Local page:=it.Value 'ManPage
|
|
Local page:=it.Value 'ManPage
|
|
|
|
|
|
|
|
+ Print "Making manual page:"+path
|
|
|
|
+
|
|
Local dir:=ExtractDir( path ),cd:=".."
|
|
Local dir:=ExtractDir( path ),cd:=".."
|
|
While dir<>module.baseDir+"docs/" And Not IsRootDir( dir )
|
|
While dir<>module.baseDir+"docs/" And Not IsRootDir( dir )
|
|
dir=ExtractDir( dir )
|
|
dir=ExtractDir( dir )
|
|
@@ -66,6 +72,8 @@ Class DocsMaker
|
|
Local md:=stringio.LoadString( mdocs )
|
|
Local md:=stringio.LoadString( mdocs )
|
|
If Not md Return ""
|
|
If Not md Return ""
|
|
|
|
|
|
|
|
+ Print "Making module docs:"+mdocs
|
|
|
|
+
|
|
_md.Emit( md )
|
|
_md.Emit( md )
|
|
|
|
|
|
Local docs:=_md.Flush()
|
|
Local docs:=_md.Flush()
|
|
@@ -95,7 +103,7 @@ Class DocsMaker
|
|
Local nmspaceDocs:=New StringMap<String>
|
|
Local nmspaceDocs:=New StringMap<String>
|
|
|
|
|
|
For Local fscope:=Eachin _module.fileScopes
|
|
For Local fscope:=Eachin _module.fileScopes
|
|
-
|
|
|
|
|
|
+
|
|
Local nmspace:=Cast<NamespaceScope>( fscope.outer )
|
|
Local nmspace:=Cast<NamespaceScope>( fscope.outer )
|
|
If Not nmspace Continue
|
|
If Not nmspace Continue
|
|
|
|
|
|
@@ -112,6 +120,9 @@ Class DocsMaker
|
|
BeginNode( _module.name,page )
|
|
BeginNode( _module.name,page )
|
|
|
|
|
|
For Local nmspace:=Eachin nmspaces.Values
|
|
For Local nmspace:=Eachin nmspaces.Values
|
|
|
|
+
|
|
|
|
+ Print "Making namespace docs:"+nmspace.Name
|
|
|
|
+
|
|
EmitNamespace( nmspace,nmspaceDocs[nmspace.Name] )
|
|
EmitNamespace( nmspace,nmspaceDocs[nmspace.Name] )
|
|
Next
|
|
Next
|
|
|
|
|
|
@@ -206,8 +217,12 @@ Class DocsMaker
|
|
End
|
|
End
|
|
|
|
|
|
Method ResolveLink:String( path:String,name:String,scope:Scope )
|
|
Method ResolveLink:String( path:String,name:String,scope:Scope )
|
|
|
|
+
|
|
|
|
+ If Not name name=path
|
|
|
|
+
|
|
|
|
+ If path.StartsWith( "http:" ) Or path.StartsWith( "https:" ) Return "<a href='"+path+"'>"+name+"</a>"
|
|
|
|
|
|
-' Print "Find link:"+path
|
|
|
|
|
|
+' Print "ResolveLink( path="+path+", name="+name+" )"
|
|
|
|
|
|
Local i0:=0
|
|
Local i0:=0
|
|
Local tpath:=""
|
|
Local tpath:=""
|
|
@@ -218,14 +233,12 @@ Class DocsMaker
|
|
|
|
|
|
If i1=-1
|
|
If i1=-1
|
|
|
|
|
|
- If Not scope Return ""
|
|
|
|
|
|
+ If Not scope Return name
|
|
|
|
|
|
Local id:=path.Slice( i0 )
|
|
Local id:=path.Slice( i0 )
|
|
|
|
|
|
Local node:=scope.FindNode( FixKeyword( id ) )
|
|
Local node:=scope.FindNode( FixKeyword( id ) )
|
|
- If Not node
|
|
|
|
- Return path
|
|
|
|
- Endif
|
|
|
|
|
|
+ If Not node Return name
|
|
|
|
|
|
tpath+=id
|
|
tpath+=id
|
|
|
|
|
|
@@ -247,7 +260,7 @@ Class DocsMaker
|
|
If ctype Return MakeLink( name,ctype.cdecl,ctype.scope.outer )
|
|
If ctype Return MakeLink( name,ctype.cdecl,ctype.scope.outer )
|
|
|
|
|
|
Print "Can't resolve link:"+path+", name="+name+", id="+id
|
|
Print "Can't resolve link:"+path+", name="+name+", id="+id
|
|
- Return name ? name Else path
|
|
|
|
|
|
+ Return name
|
|
Endif
|
|
Endif
|
|
|
|
|
|
Local id:=path.Slice( i0,i1 )
|
|
Local id:=path.Slice( i0,i1 )
|
|
@@ -266,6 +279,7 @@ Class DocsMaker
|
|
type=fscope.nmspace.ntype
|
|
type=fscope.nmspace.ntype
|
|
Exit
|
|
Exit
|
|
Next
|
|
Next
|
|
|
|
+ If Not type type=Builder.monkeyNamespace.FindType( FixKeyword( id ) )
|
|
Endif
|
|
Endif
|
|
|
|
|
|
If Not type
|
|
If Not type
|
|
@@ -508,7 +522,9 @@ Class DocsMaker
|
|
End
|
|
End
|
|
|
|
|
|
Method DocsHidden:Bool( decl:Decl,access:Int )
|
|
Method DocsHidden:Bool( decl:Decl,access:Int )
|
|
|
|
+
|
|
If access And (decl.flags & access) Return DocsHidden( decl )
|
|
If access And (decl.flags & access) Return DocsHidden( decl )
|
|
|
|
+
|
|
Return True
|
|
Return True
|
|
End
|
|
End
|
|
|
|
|
|
@@ -788,7 +804,7 @@ Class DocsMaker
|
|
If Not vvar Or vvar.transFile.module<>_module Continue
|
|
If Not vvar Or vvar.transFile.module<>_module Continue
|
|
|
|
|
|
Local decl:=vvar.vdecl
|
|
Local decl:=vvar.vdecl
|
|
- If decl.kind<>kind Or DocsHidden( decl,DECL_PUBLIC ) Continue
|
|
|
|
|
|
+ If decl.kind<>kind Or DocsHidden( decl ) Continue
|
|
|
|
|
|
_linkScope=vvar.scope
|
|
_linkScope=vvar.scope
|
|
|
|
|
|
@@ -817,7 +833,7 @@ Class DocsMaker
|
|
If Not atype Continue
|
|
If Not atype Continue
|
|
|
|
|
|
Local decl:=atype.adecl
|
|
Local decl:=atype.adecl
|
|
- If decl.kind<>kind Or DocsHidden( decl,DECL_PUBLIC ) Continue
|
|
|
|
|
|
+ If decl.kind<>kind Or DocsHidden( decl ) Continue
|
|
|
|
|
|
_linkScope=atype.scope
|
|
_linkScope=atype.scope
|
|
|
|
|
|
@@ -846,7 +862,7 @@ Class DocsMaker
|
|
If Not etype Continue
|
|
If Not etype Continue
|
|
|
|
|
|
Local decl:=etype.edecl
|
|
Local decl:=etype.edecl
|
|
- If decl.kind<>kind Or DocsHidden( decl,DECL_PUBLIC ) Continue
|
|
|
|
|
|
+ If decl.kind<>kind Or DocsHidden( decl ) Continue
|
|
|
|
|
|
_linkScope=etype.scope.outer
|
|
_linkScope=etype.scope.outer
|
|
|
|
|
|
@@ -875,7 +891,7 @@ Class DocsMaker
|
|
If Not ctype Or ctype.transFile.module<>_module Continue
|
|
If Not ctype Or ctype.transFile.module<>_module Continue
|
|
|
|
|
|
Local decl:=ctype.cdecl
|
|
Local decl:=ctype.cdecl
|
|
- If decl.kind<>kind Or DocsHidden( decl,DECL_PUBLIC ) Continue
|
|
|
|
|
|
+ If decl.kind<>kind Or DocsHidden( decl ) Continue
|
|
|
|
|
|
_linkScope=ctype.scope '.outer
|
|
_linkScope=ctype.scope '.outer
|
|
|
|
|
|
@@ -957,7 +973,7 @@ Class DocsMaker
|
|
If Not plist Continue
|
|
If Not plist Continue
|
|
|
|
|
|
Local decl:=plist.pdecl
|
|
Local decl:=plist.pdecl
|
|
- If decl.kind<>kind Or DocsHidden( decl,DECL_PUBLIC ) Continue
|
|
|
|
|
|
+ If decl.kind<>kind Or DocsHidden( decl ) Continue
|
|
|
|
|
|
Local func:=plist.getFunc
|
|
Local func:=plist.getFunc
|
|
If Not func
|
|
If Not func
|
|
@@ -999,8 +1015,7 @@ Class DocsMaker
|
|
If (func.IsMethod Or func.IsCtor) And func.scope<>scope Continue
|
|
If (func.IsMethod Or func.IsCtor) And func.scope<>scope Continue
|
|
|
|
|
|
Local decl:=func.fdecl
|
|
Local decl:=func.fdecl
|
|
-
|
|
|
|
- If DocsHidden( decl,DECL_PUBLIC ) Continue
|
|
|
|
|
|
+ If DocsHidden( decl ) Continue
|
|
|
|
|
|
If kind="constructor"
|
|
If kind="constructor"
|
|
If decl.ident<>"new" Continue
|
|
If decl.ident<>"new" Continue
|