Skip to content

Commit 735d0d3

Browse files
authored
Merge branch 'main' into april-changelog
2 parents a444250 + a249ddc commit 735d0d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+615
-1528
lines changed

api-playground/mdx/configuration.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Mintlify allows you to define your API endpoints using a combination of `docs.js
3131
}
3232
```
3333

34-
Find a full list of API configurations [here](/settings/global#param-api).
34+
Find a full list of API configurations [here](/core-concepts/settings#param-api).
3535
</Step>
3636

3737
<Step title="Create your endpoint pages">
@@ -53,7 +53,7 @@ Mintlify allows you to define your API endpoints using a combination of `docs.js
5353

5454
<Note>
5555

56-
If you have `server` configured in [docs.json](/settings/global), you can use relative paths like `/v1/endpoint`.
56+
If you have `server` configured in [docs.json](/core-concepts/settings), you can use relative paths like `/v1/endpoint`.
5757

5858
</Note>
5959

api-playground/openapi/setup.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ and the API playground will be automatically generated from the OpenAPI document
8181
If you have multiple OpenAPI files, include the path to the OpenAPI file to ensure Mintlify finds the correct OpenAPI document. This is not required if you have
8282
only one OpenAPI file - it will automatically detect your OpenAPI file.
8383

84-
If you want to reference an external OpenAPI file using this method, provide the file’s URL in the docs.json. See [here](https://mintlify.com/docs/settings/global#param-source-4) for the correct format.
84+
If you want to reference an external OpenAPI file using this method, provide the file’s URL in the docs.json. See [here](https://mintlify.com/docs/core-concepts/settings#param-source-4) for the correct format.
8585

8686
<CodeGroup>
8787
```md Example
@@ -133,7 +133,7 @@ npx @mintlify/scraping@latest openapi-file <path-to-openapi-file> -o api-referen
133133
Learn more about our scraping package [here](https://www.npmjs.com/package/@mintlify/scraping).
134134

135135
The scraper will output an array of
136-
[Navigation entries](/settings/global#structure) containing your OpenAPI MDX
136+
[Navigation entries](/core-concepts/settings#structure) containing your OpenAPI MDX
137137
files. You can either append these entries to your existing Navigation, or
138138
reorder and add the files to your navigation manually.
139139

api-playground/troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Here's a list of common issues we've seen customers run into:
7070
requests, then all of these requests will fail. To fix this, configure your reverse proxy to
7171
allow `POST` requests to the `/api/request` path.
7272

73-
Alternatively, if your reverse proxy prevents you from accepting `POST` requests, you can configure Mintlify to send requests directly to your backend with the `api.playground.proxy` setting in the `docs.json`, as described [here](/settings/global#api-configurations). This will
73+
Alternatively, if your reverse proxy prevents you from accepting `POST` requests, you can configure Mintlify to send requests directly to your backend with the `api.playground.proxy` setting in the `docs.json`, as described [here](/core-concepts/settings#api-configurations). This will
7474
likely require you to configure CORS on your server, as these requests will now come directly
7575
from your users' browsers.
7676
</Accordion>

api-reference/introduction.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Introduction
3+
icon: "book-open"
34
---
45

56
## Trigger Updates

changelog.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ mode: "center"
1010
<Frame>
1111
![AI Translations graphic](/images/changelog/translations.png)
1212
</Frame>
13-
Translate all of your documentation with AI. [Learn more.](/navigation/localization)
13+
14+
Translate all of your documentation with AI. [Learn more.](/core-concepts/navigation/localization)
1415

1516
## Export docs to PDF in beta
1617

@@ -83,7 +84,8 @@ mode: "center"
8384
<Frame>
8485
![graphic with text "Themes v2"](/images/changelog/themes.png)
8586
</Frame>
86-
New [pre-built themes](/themes) to modify the look & feel of your docs. Configure via your [docs.json file](/settings/global).
87+
88+
New [pre-built themes](/themes) to modify the look & feel of your docs. Configure via your [docs.json file](/core-concepts/settings).
8789

8890
Now available:
8991

@@ -94,7 +96,7 @@ mode: "center"
9496
## Other improvements
9597

9698
- [Guide to Technical Writing:](https://mintlify.com/guides/introduction)Best practices for writing technical documentation, including audience research, content types, and writing tips.
97-
- [Dropdown component](/navigation/divisions#dropdowns): Organize navigation with a dropdown, in addition to tabs and anchors.
99+
- [Dropdown component](/core-concepts/navigation/divisions#dropdowns): Organize navigation with a dropdown, in addition to tabs and anchors.
98100
- [AI syntax fixer](https://x.com/ricardonunez_io/status/1892334887644123192): The web editor will catch if there’s a parsing error and use AI to suggest fixes.
99101
</Update>
100102

@@ -151,7 +153,7 @@ mode: "center"
151153
</Frame>
152154
We've revamped our web editor so that you can now update docs with a fully WYSIWYG experience, while syncing with markdown.
153155

154-
Check out our [docs on getting started with Web Editor](/web-editor).
156+
Check out our [docs on getting started with Web Editor](/editor).
155157

156158
## /llms.txt support
157159

@@ -315,7 +317,7 @@ mode: "center"
315317
`disableProxy` to disable this behavior and support request types like file
316318
uploads.
317319

318-
- [Learn more about API configurations](/settings/global#api-configurations)
320+
- [Learn more about API configurations](/core-concepts/settings#api-configurations)
319321

320322
## Mobile SEO improvements
321323

code.mdx

Lines changed: 164 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Code Blocks"
2+
title: "Code"
33
description: "Display inline code and code blocks"
44
icon: 'code'
55
---
@@ -38,4 +38,166 @@ class HelloWorld {
3838
```
3939
````
4040

41-
Visit the [Code Block page](/content/components/code) for more detailed docs.
41+
## Syntax Highlighting
42+
43+
Put the name of your programming language after the three backticks to get syntax highlighting.
44+
45+
We use [Prism](https://prismjs.com/#supported-languages) for syntax highlighting. [Test Drive Prism](https://prismjs.com/test.html#language=markup) lists all the languages supported.
46+
47+
```java
48+
class HelloWorld {
49+
public static void main(String[] args) {
50+
System.out.println("Hello, World!");
51+
}
52+
}
53+
```
54+
55+
````md
56+
```java
57+
class HelloWorld {
58+
public static void main(String[] args) {
59+
System.out.println("Hello, World!");
60+
}
61+
}
62+
```
63+
````
64+
65+
## Names
66+
67+
Add a title after the programming language to set the name of your code example. The text can be anything as long as its all in one line.
68+
69+
```javascript Code Block Example
70+
const hello = "world";
71+
```
72+
73+
````md Code Block Example
74+
```javascript Code Block Example
75+
const hello = "world";
76+
```
77+
````
78+
79+
## Line Highlighting
80+
81+
Highlight specific lines in your code blocks by adding a special comment after the language identifier. Use curly braces `{}` and specify line numbers or ranges separated by commas.
82+
83+
```javascript Line Highlighting Example {1,3-5}
84+
const greeting = "Hello, World!";
85+
function sayHello() {
86+
console.log(greeting);
87+
}
88+
sayHello();
89+
```
90+
91+
````md
92+
```javascript Line Highlighting Example {1,3-5}
93+
const greeting = "Hello, World!";
94+
function sayHello() {
95+
console.log(greeting);
96+
}
97+
sayHello();
98+
```
99+
````
100+
101+
## Expandable
102+
103+
If you have a long code block and `[expandable]` after your title to make it close and expand.
104+
105+
```python library.py [expandable]
106+
from datetime import datetime, timedelta
107+
from typing import Dict, List, Optional
108+
from dataclasses import dataclass
109+
110+
@dataclass
111+
class Book:
112+
title: str
113+
author: str
114+
isbn: str
115+
checked_out: bool = False
116+
due_date: Optional[datetime] = None
117+
118+
class Library:
119+
def __init__(self):
120+
self.books: Dict[str, Book] = {}
121+
self.checkouts: Dict[str, List[str]] = {} # patron -> list of ISBNs
122+
123+
def add_book(self, book: Book) -> None:
124+
if book.isbn in self.books:
125+
raise ValueError(f"Book with ISBN {book.isbn} already exists")
126+
self.books[book.isbn] = book
127+
128+
def checkout_book(self, isbn: str, patron: str, days: int = 14) -> None:
129+
if patron not in self.checkouts:
130+
self.checkouts[patron] = []
131+
132+
book = self.books.get(isbn)
133+
if not book:
134+
raise ValueError("Book not found")
135+
136+
if book.checked_out:
137+
raise ValueError("Book is already checked out")
138+
139+
if len(self.checkouts[patron]) >= 3:
140+
raise ValueError("Patron has reached checkout limit")
141+
142+
book.checked_out = True
143+
book.due_date = datetime.now() + timedelta(days=days)
144+
self.checkouts[patron].append(isbn)
145+
146+
def return_book(self, isbn: str) -> float:
147+
book = self.books.get(isbn)
148+
if not book or not book.checked_out:
149+
raise ValueError("Book not found or not checked out")
150+
151+
late_fee = 0.0
152+
if datetime.now() > book.due_date:
153+
days_late = (datetime.now() - book.due_date).days
154+
late_fee = days_late * 0.50
155+
156+
book.checked_out = False
157+
book.due_date = None
158+
159+
# Remove from patron's checkouts
160+
for patron, books in self.checkouts.items():
161+
if isbn in books:
162+
books.remove(isbn)
163+
break
164+
165+
return late_fee
166+
167+
def search(self, query: str) -> List[Book]:
168+
query = query.lower()
169+
return [
170+
book for book in self.books.values()
171+
if query in book.title.lower() or query in book.author.lower()
172+
]
173+
174+
def main():
175+
library = Library()
176+
177+
# Add some books
178+
books = [
179+
Book("The Hobbit", "J.R.R. Tolkien", "978-0-261-10295-4"),
180+
Book("1984", "George Orwell", "978-0-452-28423-4"),
181+
]
182+
183+
for book in books:
184+
library.add_book(book)
185+
186+
# Checkout and return example
187+
library.checkout_book("978-0-261-10295-4", "patron123")
188+
late_fee = library.return_book("978-0-261-10295-4")
189+
print(f"Late fee: ${late_fee:.2f}")
190+
191+
if __name__ == "__main__":
192+
main()
193+
```
194+
195+
````md
196+
```javascript Expandable Example [expandable]
197+
const greeting = "Hello, World!";
198+
function sayHello() {
199+
console.log(greeting);
200+
}
201+
sayHello();
202+
```
203+
````

components/accordions.mdx

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
title: "Accordions"
3+
description: "A dropdown component to toggle content visibility"
4+
icon: "chevron-down"
5+
---
6+
7+
<Accordion title="I am an Accordion.">
8+
You can put any content in here, including other components, like code:
9+
```java HelloWorld.java
10+
class HelloWorld {
11+
public static void main(String[] args) {
12+
System.out.println("Hello, World!");
13+
}
14+
}
15+
```
16+
</Accordion>
17+
18+
<RequestExample>
19+
20+
````jsx Accordion Example
21+
<Accordion title="I am an Accordion.">
22+
You can put any content in here, including other components, like code:
23+
24+
```java HelloWorld.java
25+
class HelloWorld {
26+
public static void main(String[] args) {
27+
System.out.println("Hello, World!");
28+
}
29+
}
30+
```
31+
</Accordion>
32+
````
33+
34+
````jsx Accordion Group Example
35+
<AccordionGroup>
36+
<Accordion title="FAQ without Icon">
37+
You can put other components inside Accordions.
38+
39+
```java HelloWorld.java
40+
class HelloWorld {
41+
public static void main(String[] args) {
42+
System.out.println("Hello, World!");
43+
}
44+
}
45+
```
46+
47+
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
48+
</Accordion>
49+
50+
<Accordion title="FAQ with Icon" icon="alien-8bit">
51+
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
52+
</Accordion>
53+
54+
<Accordion title="FAQ without Icon">
55+
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
56+
</Accordion>
57+
</AccordionGroup>
58+
````
59+
60+
</RequestExample>
61+
62+
### Props
63+
64+
<ResponseField name="title" type="string" required>
65+
Title in the Accordion preview.
66+
</ResponseField>
67+
68+
<ResponseField name="description" type="string">
69+
Detail below the title in the Accordion preview.
70+
</ResponseField>
71+
72+
<ResponseField name="defaultOpen" type="boolean" default="false">
73+
Whether the Accordion is open by default.
74+
</ResponseField>
75+
76+
<ResponseField name="icon" type="string or svg">
77+
A [Font Awesome icon](https://fontawesome.com/icons), [Lucide
78+
icon](https://lucide.dev/icons), or SVG code
79+
</ResponseField>
80+
81+
<ResponseField name="iconType" type="string">
82+
One of "regular", "solid", "light", "thin", "sharp-solid", "duotone", or
83+
"brands"
84+
</ResponseField>
85+
86+
Use [AccordionGroup](/content/components/accordion-groups) to create a group of Accordions.
87+
88+
## Accordion Groups
89+
90+
You can group multiple accordions into a single display. Simply add `<AccordionGroup>` around your existing `<Accordion>` components.
91+
92+
<AccordionGroup>
93+
<Accordion title="FAQ without Icon">
94+
You can put other components inside Accordions.
95+
96+
```java HelloWorld.java
97+
class HelloWorld {
98+
public static void main(String[] args) {
99+
System.out.println("Hello, World!");
100+
}
101+
}
102+
```
103+
104+
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
105+
106+
</Accordion>
107+
108+
<Accordion title="FAQ with Icon" icon="bot">
109+
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
110+
</Accordion>
111+
112+
<Accordion title="FAQ without Icon">
113+
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
114+
</Accordion>
115+
</AccordionGroup>

0 commit comments

Comments
 (0)