(build-url path)Constructs a URL for a given path on the diffrhythm.ai website.
Args: path: A string representing the path to append to the base URL.
Returns: A string representing the complete URL.
Example: (build-url "about") ;=> "https://diffrhythm.ai/about"
Constructs a URL for a given path on the diffrhythm.ai website. Args: path: A string representing the path to append to the base URL. Returns: A string representing the complete URL. Example: (build-url "about") ;=> "https://diffrhythm.ai/about"
(extract-title metadata)Extracts a title-like string from a map representing metadata.
This function looks for keys like :title, :name, or :id (in that order) and returns the value associated with the first key found. If none of these keys are present, it returns nil. This is useful for handling potentially varying metadata structures.
Args: metadata: A map representing metadata.
Returns: A string representing the title, or nil if no title-like key is found.
Example: (extract-title {:name "My Project", :description "A cool project"}) ;=> "My Project" (extract-title {:id 123, :description "Another project"}) ;=> 123 (extract-title {:description "Just a description"}) ;=> nil
Extracts a title-like string from a map representing metadata.
This function looks for keys like :title, :name, or :id (in that order)
and returns the value associated with the first key found. If none
of these keys are present, it returns nil. This is useful for
handling potentially varying metadata structures.
Args:
metadata: A map representing metadata.
Returns:
A string representing the title, or nil if no title-like key is found.
Example:
(extract-title {:name "My Project", :description "A cool project"}) ;=> "My Project"
(extract-title {:id 123, :description "Another project"}) ;=> 123
(extract-title {:description "Just a description"}) ;=> nil
(generate-mock-data count)Generates a list of mock data maps for projects on diffrhythm.ai.
This function creates a list of maps, each representing a project, with fields like :id, :title, :description, and :url. The number of projects generated is determined by the count argument. The :id is simply the index of the project in the list.
Args: count: The number of mock projects to generate.
Returns: A list of maps, each representing a mock project.
Example: (generate-mock-data 3) ;=> [{:id 0, :title "Project 0", :description "Mock project description 0", :url "https://diffrhythm.ai/projects/0"} {:id 1, :title "Project 1", :description "Mock project description 1", :url "https://diffrhythm.ai/projects/1"} {:id 2, :title "Project 2", :description "Mock project description 2", :url "https://diffrhythm.ai/projects/2"}]
Generates a list of mock data maps for projects on diffrhythm.ai.
This function creates a list of maps, each representing a project, with
fields like :id, :title, :description, and :url. The number of projects
generated is determined by the count argument. The :id is simply the index
of the project in the list.
Args:
count: The number of mock projects to generate.
Returns:
A list of maps, each representing a mock project.
Example:
(generate-mock-data 3) ;=> [{:id 0, :title "Project 0", :description "Mock project description 0", :url "https://diffrhythm.ai/projects/0"} {:id 1, :title "Project 1", :description "Mock project description 1", :url "https://diffrhythm.ai/projects/1"} {:id 2, :title "Project 2", :description "Mock project description 2", :url "https://diffrhythm.ai/projects/2"}]
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |