st.write('Hello', 'World')",
"source": "https://github.com/streamlit/streamlit/blob/1.40.0/lib/streamlit/write.py#L42"
}
}
}
```
### Search Index Update
```bash
# Rebuild Algolia search index
make search
```
```javascript
// scripts/build-search-index.js
const algoliasearch = require('algoliasearch');
const { convert } = require('html-to-text');
const fs = require('fs');
const client = algoliasearch('XNXFGO6BQ1', process.env.ALGOLIA_ADMIN_KEY);
const index = client.initIndex('documentation');
// Parse all built HTML files
const pages = getAllFilesInDirectory('.next/server/pages');
const records = pages.map(page => {
const html = fs.readFileSync(page, 'utf8');
return {
objectID: extractUrl(page),
title: extractTitle(html),
content: convert(html, { wordwrap: false }),
url: extractUrl(page),
category: extractCategory(html),
version: extractVersion(page),
icon: metadata.icon,
color: metadata.color
};
});
// Upload to Algolia
await index.saveObjects(records);
```
## Content Management System
### Markdown File Structure
```markdown
---
title: Create a Component
slug: /develop/concepts/custom-components/create
---
# Create a Component
This is the page content with **markdown** formatting.
wrapper around images
remarkGfm // GitHub Flavored Markdown
]
}
});
// Get menu and navigation
const menu = getMenu();
const { prev, next } = getPreviousNextFromMenu(menu, data.slug);
return {
props: {
data,
source: mdxSource,
docstrings,
menu,
prev,
next,
versionFromSlug: version,
platformFromSlug: platform
}
};
}
export default function Article({ data, source, docstrings, menu, prev, next }) {
// MDX component mapping
const components = {
// Callouts
Note,
Tip,
Warning,
Important,
// Content blocks
Code,
Image,
YouTube,
// Layouts
Flex,
Masonry,
TileContainer,
// API documentation
Autofunction: (props) => (
{data.title}
```python
import streamlit as st
import pandas as pd
df = pd.DataFrame({
'col1': [1, 2, 3, 4],
'col2': [10, 20, 30, 40]
})
st.bar_chart(df)
```
{doc.signature}
View source
{oldName} instead.}
{arg.name}
{arg.type_name && ({arg.type_name})}
{arg.is_optional && optional}
{arg.default}
{children}