diff --git a/docs/website/docs/getting-started.md b/docs/website/docs/getting-started.md index 8dbabd2430..0155bc950e 100644 --- a/docs/website/docs/getting-started.md +++ b/docs/website/docs/getting-started.md @@ -41,7 +41,7 @@ Make sure that your `dlt` version is **0.3.15** or above. Check it in the termin Let's load a list of Python objects (dictionaries) into `duckdb` and inspect the created dataset: -```python +```py import dlt data = [ @@ -128,7 +128,7 @@ The library will create/update tables, infer data types and deal with nested dat -```python +```py import dlt from dlt.common import json @@ -158,7 +158,7 @@ We import **json** from `dlt` namespace. It defaults to `orjson`(otherwise `simp Pass anything that you can load with Pandas to `dlt` -```python +```py import dlt import pandas as pd @@ -181,7 +181,7 @@ print(load_info) -```python +```py import dlt from dlt.sources.helpers import requests @@ -212,7 +212,7 @@ to sync your databases with warehouses, data lakes, or vector stores. ::: -```python +```py import dlt from sqlalchemy import create_engine @@ -257,7 +257,7 @@ For example, if the CSV file is updated, how we can refresh it in the database? One method is to tell `dlt` to replace the data in existing tables by using `write_disposition`: -```python +```py import dlt data = [ @@ -301,7 +301,7 @@ Instead of using `replace` write_disposition and downloading all issues each tim -```python +```py import dlt from dlt.sources.helpers import requests @@ -377,7 +377,7 @@ To get always fresh content of all the issues you combine incremental load with like in the script below. -```python +```py import dlt from dlt.sources.helpers import requests @@ -433,7 +433,7 @@ This is a fun but practical example that reads GitHub events from **dlt** reposi Each event type is sent to a different table in `duckdb`. -```python +```py import dlt from dlt.sources.helpers import requests @@ -511,7 +511,7 @@ Learn more: Below we extract text from PDFs and load it to [Weaviate](dlt-ecosystem/destinations/weaviate) vector store. -```python +```py import os import dlt @@ -591,7 +591,7 @@ python pdf_to_weaviate.py Now it is time to query our documents. -```python +```py import weaviate client = weaviate.Client("http://localhost:8080") diff --git a/docs/website/docs/intro.md b/docs/website/docs/intro.md index 24dd2f2b85..7051292f70 100644 --- a/docs/website/docs/intro.md +++ b/docs/website/docs/intro.md @@ -22,7 +22,7 @@ There's no need to start any backends or containers. Import `dlt` in your Python -```python +```py import dlt from dlt.sources.helpers import requests # Create a dlt pipeline that will load diff --git a/docs/website/tools/update_snippets.js b/docs/website/tools/update_snippets.js index 00f38cdfef..e6d7324a1d 100644 --- a/docs/website/tools/update_snippets.js +++ b/docs/website/tools/update_snippets.js @@ -83,7 +83,8 @@ function getSnippet(fileName, snippetName) { let result = lines.slice((snippetMap[snippetName]["start"]+1), snippetMap[snippetName]["end"]); // dedent works on strings, not on string arrays, so this is very ineffective unfortunately... result = dedent(result.join("\n")).split(/\r?\n/); - result.unshift("```python"); + const codeType = path.extname(snippetsFileName).replace(".", ""); + result.unshift(`\`\`\`${codeType}`); result.push("```"); return filterDirectives(result); }