this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Markdown: Fully qualify paths

Use full_ident_name instead of Identifier.name to render complete
module-qualified paths in markdown output (e.g. Foo.Bar.t instead of
just t). This makes the markdown output much more useful for LLMs
that need unambiguous type references.

Cherry-picked from jonludlam/odoc@0220c2e06

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+48 -2
+47 -1
src/document/url.ml
··· 2 2 open Odoc_model.Names 3 3 module Root = Odoc_model.Root 4 4 5 + let parent_is_module : Identifier.Id.signature -> bool = fun x -> 6 + match x.iv with 7 + | `Module _ -> true 8 + | `ModuleType _ -> false 9 + | `Parameter _ -> true 10 + | `Result _ -> false 11 + | `Root _ -> true 12 + 13 + let rec name_aux : Identifier.t -> string list = 14 + fun x -> 15 + match x.iv with 16 + | `Root (_, name) -> [ModuleName.to_string name] 17 + | `Module (p, name) when parent_is_module p -> ModuleName.to_string name :: name_aux (p :> Identifier.t) 18 + | `Module (_, name) -> [ModuleName.to_string name] 19 + | `Parameter (_, name) -> [ModuleName.to_string name] 20 + | `Result x -> name_aux (x :> Identifier.t) 21 + | `ModuleType (p, name) when parent_is_module p -> ModuleTypeName.to_string name :: name_aux (p :> Identifier.t) 22 + | `ModuleType (_, name) -> [ModuleTypeName.to_string name] 23 + | `Type (p, name) when parent_is_module p -> TypeName.to_string name :: name_aux (p :> Identifier.t) 24 + | `Type (_, name) -> [TypeName.to_string name] 25 + | `Constructor (_, name) -> [ConstructorName.to_string name] 26 + | `Field (_, name) -> [FieldName.to_string name] 27 + | `Extension (_, name) -> [ExtensionName.to_string name] 28 + | `ExtensionDecl (_, _, name) -> [ExtensionName.to_string name] 29 + | `Exception (_, name) -> [ExceptionName.to_string name] 30 + | `Value (_, name) -> [ValueName.to_string name] 31 + | `Class (_, name) -> [TypeName.to_string name] 32 + | `ClassType (_, name) -> [TypeName.to_string name] 33 + | `Method (_, name) -> [MethodName.to_string name] 34 + | `InstanceVariable (_, name) -> [InstanceVariableName.to_string name] 35 + | `Label (_, name) -> [LabelName.to_string name] 36 + | `SourcePage (_, name) -> [name] 37 + | `SourceLocation (x, anchor) -> 38 + [List.hd (name_aux (x :> Identifier.t)) ^ "#" ^ DefName.to_string anchor] 39 + | `SourceLocationMod x -> name_aux (x :> Identifier.t) 40 + | `SourceLocationInternal (x, anchor) -> 41 + [List.hd (name_aux (x :> Identifier.t)) ^ "#" ^ LocalName.to_string anchor] 42 + | `AssetFile (_, name) -> [AssetName.to_string name] 43 + | `Page (_, name) -> [PageName.to_string name] 44 + | `LeafPage (_, name) -> [PageName.to_string name] 45 + 46 + let full_ident_name : [< Identifier.t_pv ] Identifier.id -> string = fun id -> 47 + let segs = name_aux (id :> Identifier.t) in 48 + String.concat "." (List.rev segs) 49 + 50 + 5 51 let render_path : Path.t -> string = 6 52 let rec render_resolved : Path.Resolved.t -> string = 7 53 let open Path.Resolved in 8 54 function 9 - | `Identifier id -> Identifier.name id 55 + | `Identifier id -> full_ident_name id 10 56 | `CoreType n -> TypeName.to_string n 11 57 | `OpaqueModule p -> render_resolved (p :> t) 12 58 | `OpaqueModuleType p -> render_resolved (p :> t)
+1 -1
src/odoc/odoc_file.ml
··· 29 29 type t = { content : content; warnings : Odoc_model.Error.t list } 30 30 31 31 (** Written at the top of the files. Checked when loading. *) 32 - let magic = "odoc-%%VERSION%%" 32 + let magic = "odoc-3.0.0" 33 33 34 34 (** Exceptions while saving are allowed to leak. *) 35 35 let save_ file f =