File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " tauri-utils " : patch:enhance
3+ ---
4+
5+ Changed plugin markdown docs generation to table format.
Original file line number Diff line number Diff line change @@ -235,33 +235,33 @@ pub fn generate_schema<P: AsRef<Path>>(
235235
236236/// Generate a markdown documentation page containing the list of permissions of the plugin.
237237pub fn generate_docs ( permissions : & [ PermissionFile ] , out_dir : & Path ) -> Result < ( ) , Error > {
238- let mut docs = "# Permissions \n \n " . to_string ( ) ;
238+ let mut docs = "| Permission | Description | \n |------|-----| \n " . to_string ( ) ;
239239
240240 fn docs_from ( id : & str , description : Option < & str > ) -> String {
241- let mut docs = format ! ( "## {id}" ) ;
241+ let mut docs = format ! ( "|` {id}` " ) ;
242242 if let Some ( d) = description {
243- docs. push_str ( & format ! ( "\n \n {d}" ) ) ;
243+ docs. push_str ( & format ! ( "| {d}| " ) ) ;
244244 }
245245 docs
246246 }
247247
248248 for permission in permissions {
249249 for set in & permission. set {
250250 docs. push_str ( & docs_from ( & set. identifier , Some ( & set. description ) ) ) ;
251- docs. push_str ( " \n \n " ) ;
251+ docs. push ( '\n' ) ;
252252 }
253253
254254 if let Some ( default) = & permission. default {
255255 docs. push_str ( & docs_from ( "default" , default. description . as_deref ( ) ) ) ;
256- docs. push_str ( " \n \n " ) ;
256+ docs. push ( '\n' ) ;
257257 }
258258
259259 for permission in & permission. permission {
260260 docs. push_str ( & docs_from (
261261 & permission. identifier ,
262262 permission. description . as_deref ( ) ,
263263 ) ) ;
264- docs. push_str ( " \n \n " ) ;
264+ docs. push ( '\n' ) ;
265265 }
266266 }
267267
You can’t perform that action at this time.
0 commit comments