From 1e0b88fc9fc436c6cee8620b08d804c519410d5b Mon Sep 17 00:00:00 2001 From: Elliana May Date: Sat, 19 Aug 2023 12:21:30 +0800 Subject: [PATCH 1/8] commit fixes --- docs/api/c/api.md | 49 ++++++++++++++++++++++++++++++++++- docs/api/c/data_chunk.md | 4 +++ docs/api/c/table_functions.md | 6 +++++ docs/api/c/types.md | 8 ++++++ 4 files changed, 66 insertions(+), 1 deletion(-) diff --git a/docs/api/c/api.md b/docs/api/c/api.md index 4af786beb20..1bce61483e0 100644 --- a/docs/api/c/api.md +++ b/docs/api/c/api.md @@ -16,14 +16,18 @@ title: C API - Complete API void duckdb_disconnect(duckdb_connection *connection); const char *duckdb_library_version(); + ### **Configuration** +
duckdb_state duckdb_create_config(duckdb_config *out_config);
 size_t duckdb_config_count();
 duckdb_state duckdb_get_config_flag(size_t index, const char **out_name, const char **out_description);
 duckdb_state duckdb_set_config(duckdb_config config, const char *name, const char *option);
 void duckdb_destroy_config(duckdb_config *config);
 
+ ### **Query Execution** +
duckdb_state duckdb_query(duckdb_connection connection, const char *query, duckdb_result *out_result);
 void duckdb_destroy_result(duckdb_result *result);
 const char *duckdb_column_name(duckdb_result *result, idx_t col);
@@ -36,7 +40,9 @@ title: C API - Complete API
 bool *duckdb_nullmask_data(duckdb_result *result, idx_t col);
 const char *duckdb_result_error(duckdb_result *result);
 
+ ### **Result Functions** +
duckdb_data_chunk duckdb_result_get_chunk(duckdb_result result, idx_t chunk_index);
 bool duckdb_result_is_streaming(duckdb_result result);
 idx_t duckdb_result_chunk_count(duckdb_result result);
@@ -63,13 +69,17 @@ title: C API - Complete API
 duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t row);
 bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row);
 
+ ### **Helpers** +
void *duckdb_malloc(size_t size);
 void duckdb_free(void *ptr);
 idx_t duckdb_vector_size();
 bool duckdb_string_is_inlined(duckdb_string_t string);
 
+ ### **Date/Time/Timestamp Helpers** +
duckdb_date_struct duckdb_from_date(duckdb_date date);
 duckdb_date duckdb_to_date(duckdb_date_struct date);
 duckdb_time_struct duckdb_from_time(duckdb_time time);
@@ -77,15 +87,21 @@ title: C API - Complete API
 duckdb_timestamp_struct duckdb_from_timestamp(duckdb_timestamp ts);
 duckdb_timestamp duckdb_to_timestamp(duckdb_timestamp_struct ts);
 
+ ### **Hugeint Helpers** +
double duckdb_hugeint_to_double(duckdb_hugeint val);
 duckdb_hugeint duckdb_double_to_hugeint(double val);
 duckdb_decimal duckdb_double_to_decimal(double val, uint8_t width, uint8_t scale);
 
+ ### **Decimal Helpers** +
double duckdb_decimal_to_double(duckdb_decimal val);
 
+ ### **Prepared Statements** +
duckdb_state duckdb_prepare(duckdb_connection connection, const char *query, duckdb_prepared_statement *out_prepared_statement);
 void duckdb_destroy_prepare(duckdb_prepared_statement *prepared_statement);
 const char *duckdb_prepare_error(duckdb_prepared_statement prepared_statement);
@@ -119,13 +135,17 @@ title: C API - Complete API
 duckdb_state duckdb_arrow_scan(duckdb_connection connection, const char *table_name, duckdb_arrow_stream arrow);
 duckdb_state duckdb_arrow_array_scan(duckdb_connection connection, const char *table_name, duckdb_arrow_schema arrow_schema, duckdb_arrow_array arrow_array, duckdb_arrow_stream *out_stream);
 
+ ### **Extract Statements** +
idx_t duckdb_extract_statements(duckdb_connection connection, const char *query, duckdb_extracted_statements *out_extracted_statements);
 duckdb_state duckdb_prepare_extracted_statement(duckdb_connection connection, duckdb_extracted_statements extracted_statements, idx_t index, duckdb_prepared_statement *out_prepared_statement);
 const char *duckdb_extract_statements_error(duckdb_extracted_statements extracted_statements);
 void duckdb_destroy_extracted(duckdb_extracted_statements *extracted_statements);
 
+ ### **Pending Result Interface** +
duckdb_state duckdb_pending_prepared(duckdb_prepared_statement prepared_statement, duckdb_pending_result *out_result);
 duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statement prepared_statement, duckdb_pending_result *out_result);
 void duckdb_destroy_pending(duckdb_pending_result *pending_result);
@@ -134,7 +154,9 @@ title: C API - Complete API
 duckdb_state duckdb_execute_pending(duckdb_pending_result pending_result, duckdb_result *out_result);
 bool duckdb_pending_execution_is_finished(duckdb_pending_state pending_state);
 
+ ### **Value Interface** +
void duckdb_destroy_value(duckdb_value *value);
 duckdb_value duckdb_create_varchar(const char *text);
 duckdb_value duckdb_create_varchar_length(const char *text, idx_t length);
@@ -142,7 +164,9 @@ title: C API - Complete API
 char *duckdb_get_varchar(duckdb_value value);
 int64_t duckdb_get_int64(duckdb_value value);
 
+ ### **Logical Type Interface** +
duckdb_logical_type duckdb_create_logical_type(duckdb_type type);
 duckdb_logical_type duckdb_create_list_type(duckdb_logical_type type);
 duckdb_logical_type duckdb_create_map_type(duckdb_logical_type key_type, duckdb_logical_type value_type);
@@ -166,7 +190,9 @@ title: C API - Complete API
 duckdb_logical_type duckdb_union_type_member_type(duckdb_logical_type type, idx_t index);
 void duckdb_destroy_logical_type(duckdb_logical_type *type);
 
+ ### **Data Chunk Interface** +
duckdb_data_chunk duckdb_create_data_chunk(duckdb_logical_type *types, idx_t column_count);
 void duckdb_destroy_data_chunk(duckdb_data_chunk *chunk);
 void duckdb_data_chunk_reset(duckdb_data_chunk chunk);
@@ -175,7 +201,9 @@ title: C API - Complete API
 idx_t duckdb_data_chunk_get_size(duckdb_data_chunk chunk);
 void duckdb_data_chunk_set_size(duckdb_data_chunk chunk, idx_t size);
 
+ ### **Vector Interface** +
duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);
 void *duckdb_vector_get_data(duckdb_vector vector);
 uint64_t *duckdb_vector_get_validity(duckdb_vector vector);
@@ -188,13 +216,17 @@ title: C API - Complete API
 duckdb_state duckdb_list_vector_reserve(duckdb_vector vector, idx_t required_capacity);
 duckdb_vector duckdb_struct_vector_get_child(duckdb_vector vector, idx_t index);
 
+ ### **Validity Mask Functions** +
bool duckdb_validity_row_is_valid(uint64_t *validity, idx_t row);
 void duckdb_validity_set_row_validity(uint64_t *validity, idx_t row, bool valid);
 void duckdb_validity_set_row_invalid(uint64_t *validity, idx_t row);
 void duckdb_validity_set_row_valid(uint64_t *validity, idx_t row);
 
+ ### **Table Functions** +
duckdb_table_function duckdb_create_table_function();
 void duckdb_destroy_table_function(duckdb_table_function *table_function);
 void duckdb_table_function_set_name(duckdb_table_function table_function, const char *name);
@@ -208,7 +240,9 @@ title: C API - Complete API
 void duckdb_table_function_supports_projection_pushdown(duckdb_table_function table_function, bool pushdown);
 duckdb_state duckdb_register_table_function(duckdb_connection con, duckdb_table_function function);
 
+ ### **Table Function Bind** +
void *duckdb_bind_get_extra_info(duckdb_bind_info info);
 void duckdb_bind_add_result_column(duckdb_bind_info info, const char *name, duckdb_logical_type type);
 idx_t duckdb_bind_get_parameter_count(duckdb_bind_info info);
@@ -218,7 +252,9 @@ title: C API - Complete API
 void duckdb_bind_set_cardinality(duckdb_bind_info info, idx_t cardinality, bool is_exact);
 void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
 
+ ### **Table Function Init** +
void *duckdb_init_get_extra_info(duckdb_init_info info);
 void *duckdb_init_get_bind_data(duckdb_init_info info);
 void duckdb_init_set_init_data(duckdb_init_info info, void *init_data, duckdb_delete_callback_t destroy);
@@ -227,20 +263,26 @@ title: C API - Complete API
 void duckdb_init_set_max_threads(duckdb_init_info info, idx_t max_threads);
 void duckdb_init_set_error(duckdb_init_info info, const char *error);
 
+ ### **Table Function** +
void *duckdb_function_get_extra_info(duckdb_function_info info);
 void *duckdb_function_get_bind_data(duckdb_function_info info);
 void *duckdb_function_get_init_data(duckdb_function_info info);
 void *duckdb_function_get_local_init_data(duckdb_function_info info);
 void duckdb_function_set_error(duckdb_function_info info, const char *error);
 
+ ### **Replacement Scans** +
void duckdb_add_replacement_scan(duckdb_database db, duckdb_replacement_callback_t replacement, void *extra_data, duckdb_delete_callback_t delete_callback);
 void duckdb_replacement_scan_set_function_name(duckdb_replacement_scan_info info, const char *function_name);
 void duckdb_replacement_scan_add_parameter(duckdb_replacement_scan_info info, duckdb_value parameter);
 void duckdb_replacement_scan_set_error(duckdb_replacement_scan_info info, const char *error);
 
+ ### **Appender** +
duckdb_state duckdb_appender_create(duckdb_connection connection, const char *schema, const char *table, duckdb_appender *out_appender);
 const char *duckdb_appender_error(duckdb_appender appender);
 duckdb_state duckdb_appender_flush(duckdb_appender appender);
@@ -270,7 +312,9 @@ title: C API - Complete API
 duckdb_state duckdb_append_null(duckdb_appender appender);
 duckdb_state duckdb_append_data_chunk(duckdb_appender appender, duckdb_data_chunk chunk);
 
+ ### **Arrow Interface** +
duckdb_state duckdb_query_arrow(duckdb_connection connection, const char *query, duckdb_arrow *out_result);
 duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_arrow_schema *out_schema);
 duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arrow_array *out_array);
@@ -280,7 +324,9 @@ title: C API - Complete API
 const char *duckdb_query_arrow_error(duckdb_arrow result);
 void duckdb_destroy_arrow(duckdb_arrow *result);
 
+ ### **Threading Information** +
void duckdb_execute_tasks(duckdb_database database, idx_t max_tasks);
 duckdb_task_state duckdb_create_task_state(duckdb_database database);
 void duckdb_execute_tasks_state(duckdb_task_state state);
@@ -290,7 +336,9 @@ title: C API - Complete API
 void duckdb_destroy_task_state(duckdb_task_state state);
 bool duckdb_execution_is_finished(duckdb_connection con);
 
+ ### **Streaming Result Interface** +
duckdb_data_chunk duckdb_stream_fetch_chunk(duckdb_result result);
 
@@ -1738,7 +1786,6 @@ The vector size. Whether or not the duckdb_string_t value is inlined. This means that the data of the string does not have a separate allocation. - #### Syntax --- diff --git a/docs/api/c/data_chunk.md b/docs/api/c/data_chunk.md index c50eab06141..3aaa1992625 100644 --- a/docs/api/c/data_chunk.md +++ b/docs/api/c/data_chunk.md @@ -21,7 +21,9 @@ The primary manner of interfacing with data chunks is by obtaining the internal idx_t duckdb_data_chunk_get_size(duckdb_data_chunk chunk); void duckdb_data_chunk_set_size(duckdb_data_chunk chunk, idx_t size); + #### Vector Interface +
duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);
 void *duckdb_vector_get_data(duckdb_vector vector);
 uint64_t *duckdb_vector_get_validity(duckdb_vector vector);
@@ -34,7 +36,9 @@ The primary manner of interfacing with data chunks is by obtaining the internal
 duckdb_state duckdb_list_vector_reserve(duckdb_vector vector, idx_t required_capacity);
 duckdb_vector duckdb_struct_vector_get_child(duckdb_vector vector, idx_t index);
 
+ #### Validity Mask Functions +
bool duckdb_validity_row_is_valid(uint64_t *validity, idx_t row);
 void duckdb_validity_set_row_validity(uint64_t *validity, idx_t row, bool valid);
 void duckdb_validity_set_row_invalid(uint64_t *validity, idx_t row);
diff --git a/docs/api/c/table_functions.md b/docs/api/c/table_functions.md
index 2aa0516327c..2ab593705bc 100644
--- a/docs/api/c/table_functions.md
+++ b/docs/api/c/table_functions.md
@@ -20,7 +20,9 @@ The table function API can be used to define a table function that can then be c
 void duckdb_table_function_supports_projection_pushdown(duckdb_table_function table_function, bool pushdown);
 duckdb_state duckdb_register_table_function(duckdb_connection con, duckdb_table_function function);
 
+ #### Table Function Bind +
void *duckdb_bind_get_extra_info(duckdb_bind_info info);
 void duckdb_bind_add_result_column(duckdb_bind_info info, const char *name, duckdb_logical_type type);
 idx_t duckdb_bind_get_parameter_count(duckdb_bind_info info);
@@ -30,7 +32,9 @@ The table function API can be used to define a table function that can then be c
 void duckdb_bind_set_cardinality(duckdb_bind_info info, idx_t cardinality, bool is_exact);
 void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
 
+ #### Table Function Init +
void *duckdb_init_get_extra_info(duckdb_init_info info);
 void *duckdb_init_get_bind_data(duckdb_init_info info);
 void duckdb_init_set_init_data(duckdb_init_info info, void *init_data, duckdb_delete_callback_t destroy);
@@ -39,7 +43,9 @@ The table function API can be used to define a table function that can then be c
 void duckdb_init_set_max_threads(duckdb_init_info info, idx_t max_threads);
 void duckdb_init_set_error(duckdb_init_info info, const char *error);
 
+ #### Table Function +
void *duckdb_function_get_extra_info(duckdb_function_info info);
 void *duckdb_function_get_bind_data(duckdb_function_info info);
 void *duckdb_function_get_init_data(duckdb_function_info info);
diff --git a/docs/api/c/types.md b/docs/api/c/types.md
index c1939066226..5daa6bf4529 100644
--- a/docs/api/c/types.md
+++ b/docs/api/c/types.md
@@ -95,7 +95,9 @@ For more information about data chunks, see the [documentation on data chunks](d
 duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t row);
 bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row);
 
+ #### Date/Time/Timestamp Helpers +
duckdb_date_struct duckdb_from_date(duckdb_date date);
 duckdb_date duckdb_to_date(duckdb_date_struct date);
 duckdb_time_struct duckdb_from_time(duckdb_time time);
@@ -103,15 +105,21 @@ For more information about data chunks, see the [documentation on data chunks](d
 duckdb_timestamp_struct duckdb_from_timestamp(duckdb_timestamp ts);
 duckdb_timestamp duckdb_to_timestamp(duckdb_timestamp_struct ts);
 
+ #### Hugeint Helpers +
double duckdb_hugeint_to_double(duckdb_hugeint val);
 duckdb_hugeint duckdb_double_to_hugeint(double val);
 duckdb_decimal duckdb_double_to_decimal(double val, uint8_t width, uint8_t scale);
 
+ #### Decimal Helpers +
double duckdb_decimal_to_double(duckdb_decimal val);
 
+ #### Logical Type Interface +
duckdb_logical_type duckdb_create_logical_type(duckdb_type type);
 duckdb_logical_type duckdb_create_list_type(duckdb_logical_type type);
 duckdb_logical_type duckdb_create_map_type(duckdb_logical_type key_type, duckdb_logical_type value_type);

From db165c718e4c8e61caec2c44992865d864e28696 Mon Sep 17 00:00:00 2001
From: Elliana May 
Date: Sat, 19 Aug 2023 12:21:53 +0800
Subject: [PATCH 2/8] update generation script

---
 scripts/generate_docs.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/scripts/generate_docs.py b/scripts/generate_docs.py
index 212b7f1bee5..94bb749f6f0 100644
--- a/scripts/generate_docs.py
+++ b/scripts/generate_docs.py
@@ -191,11 +191,11 @@ def add_function(function_prototype, documentation, group):
     function_name = extract_function_name(function_prototype_str)
     docs_str = '\n'.join(documentation) + '\n'
     (docs_str, parameters) = extract_parameters(docs_str)
-    docs_string = ''
-    docs_string += f'### `{function_name}`\n'
+    docs_string = '\n'
+    docs_string += f'### `{function_name}`\n\n'
     docs_string += '---\n'
-    docs_string += docs_str.replace('e.g. ', 'e.g., ').replace('i.e. ', 'i.e., ')
-    docs_string += '#### Syntax\n'
+    docs_string += docs_str.replace('e.g. ', 'e.g., ').replace('i.e. ', 'i.e., ').strip() +'\n' if docs_str else ''
+    docs_string += '\n#### Syntax\n\n'
     docs_string += '---\n'
     docs_string += quick_docs_start()
     docs_string += (
@@ -204,7 +204,7 @@ def add_function(function_prototype, documentation, group):
     )
     docs_string += quick_docs_end()
     if len(parameters) > 0:
-        docs_string += '#### Parameters\n'
+        docs_string += '\n#### Parameters\n\n'
         docs_string += '---\n'
         for parameter_pair in parameters:
             docs_string += "* `" + parameter_pair[0] + '`\n\n'
@@ -273,7 +273,7 @@ def replace_docs_in_file(file_name, group_name, docs_string_for_this_group):
             text = (
                 text.rsplit(api_ref_split, 1)[0]
                 + api_ref_split
-                + '\n'
+                + '\n\n'
                 + docs_string_for_this_group
             )
             found = True
@@ -303,7 +303,7 @@ def replace_docs_in_file(file_name, group_name, docs_string_for_this_group):
     else:
         quick_docs = file_docs[file_name][0]
         docs_string_for_this_group = file_docs[file_name][1]
-        quick_docs += '#### ' + group_name + '\n'
+        quick_docs += '\n#### ' + group_name + '\n\n'
         quick_docs += quick_docs_start()
     for entry in group_docs[group_name]:
         quick_docs += entry[1] + '\n'
@@ -324,8 +324,8 @@ def replace_docs_in_file(file_name, group_name, docs_string_for_this_group):
     group_name = entry[1]
     if group_name is not current_group_name:
         if current_group_name is not None:
-            total_quick_docs += quick_docs_end()
-        total_quick_docs += '### **' + group_name + '**\n'
+            total_quick_docs += quick_docs_end() + '\n'
+        total_quick_docs += '### **' + group_name + '**\n\n'
 
         total_quick_docs += quick_docs_start()
         current_group_name = group_name

From a4ebb7bef9d1325523c3502a24540ee2ffc9afb0 Mon Sep 17 00:00:00 2001
From: Elliana May 
Date: Sat, 19 Aug 2023 12:28:41 +0800
Subject: [PATCH 3/8] Bump header size

---
 docs/api/c/data_chunk.md      | 4 ++--
 docs/api/c/table_functions.md | 6 +++---
 docs/api/c/types.md           | 8 ++++----
 scripts/generate_docs.py      | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/docs/api/c/data_chunk.md b/docs/api/c/data_chunk.md
index 3aaa1992625..59481d32c32 100644
--- a/docs/api/c/data_chunk.md
+++ b/docs/api/c/data_chunk.md
@@ -22,7 +22,7 @@ The primary manner of interfacing with data chunks is by obtaining the internal
 void duckdb_data_chunk_set_size(duckdb_data_chunk chunk, idx_t size);
 
-#### Vector Interface +### Vector Interface
duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);
 void *duckdb_vector_get_data(duckdb_vector vector);
@@ -37,7 +37,7 @@ The primary manner of interfacing with data chunks is by obtaining the internal
 duckdb_vector duckdb_struct_vector_get_child(duckdb_vector vector, idx_t index);
 
-#### Validity Mask Functions +### Validity Mask Functions
bool duckdb_validity_row_is_valid(uint64_t *validity, idx_t row);
 void duckdb_validity_set_row_validity(uint64_t *validity, idx_t row, bool valid);
diff --git a/docs/api/c/table_functions.md b/docs/api/c/table_functions.md
index 2ab593705bc..70973c7c896 100644
--- a/docs/api/c/table_functions.md
+++ b/docs/api/c/table_functions.md
@@ -21,7 +21,7 @@ The table function API can be used to define a table function that can then be c
 duckdb_state duckdb_register_table_function(duckdb_connection con, duckdb_table_function function);
 
-#### Table Function Bind +### Table Function Bind
void *duckdb_bind_get_extra_info(duckdb_bind_info info);
 void duckdb_bind_add_result_column(duckdb_bind_info info, const char *name, duckdb_logical_type type);
@@ -33,7 +33,7 @@ The table function API can be used to define a table function that can then be c
 void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
 
-#### Table Function Init +### Table Function Init
void *duckdb_init_get_extra_info(duckdb_init_info info);
 void *duckdb_init_get_bind_data(duckdb_init_info info);
@@ -44,7 +44,7 @@ The table function API can be used to define a table function that can then be c
 void duckdb_init_set_error(duckdb_init_info info, const char *error);
 
-#### Table Function +### Table Function
void *duckdb_function_get_extra_info(duckdb_function_info info);
 void *duckdb_function_get_bind_data(duckdb_function_info info);
diff --git a/docs/api/c/types.md b/docs/api/c/types.md
index 5daa6bf4529..e75bedda0a2 100644
--- a/docs/api/c/types.md
+++ b/docs/api/c/types.md
@@ -96,7 +96,7 @@ For more information about data chunks, see the [documentation on data chunks](d
 bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row);
 
-#### Date/Time/Timestamp Helpers +### Date/Time/Timestamp Helpers
duckdb_date_struct duckdb_from_date(duckdb_date date);
 duckdb_date duckdb_to_date(duckdb_date_struct date);
@@ -106,19 +106,19 @@ For more information about data chunks, see the [documentation on data chunks](d
 duckdb_timestamp duckdb_to_timestamp(duckdb_timestamp_struct ts);
 
-#### Hugeint Helpers +### Hugeint Helpers
double duckdb_hugeint_to_double(duckdb_hugeint val);
 duckdb_hugeint duckdb_double_to_hugeint(double val);
 duckdb_decimal duckdb_double_to_decimal(double val, uint8_t width, uint8_t scale);
 
-#### Decimal Helpers +### Decimal Helpers
double duckdb_decimal_to_double(duckdb_decimal val);
 
-#### Logical Type Interface +### Logical Type Interface
duckdb_logical_type duckdb_create_logical_type(duckdb_type type);
 duckdb_logical_type duckdb_create_list_type(duckdb_logical_type type);
diff --git a/scripts/generate_docs.py b/scripts/generate_docs.py
index 94bb749f6f0..eeb1786f0b1 100644
--- a/scripts/generate_docs.py
+++ b/scripts/generate_docs.py
@@ -303,7 +303,7 @@ def replace_docs_in_file(file_name, group_name, docs_string_for_this_group):
     else:
         quick_docs = file_docs[file_name][0]
         docs_string_for_this_group = file_docs[file_name][1]
-        quick_docs += '\n#### ' + group_name + '\n\n'
+        quick_docs += '\n### ' + group_name + '\n\n'
         quick_docs += quick_docs_start()
     for entry in group_docs[group_name]:
         quick_docs += entry[1] + '\n'

From e0841057a76549b67e14eb1d9e486cf1a01a45ee Mon Sep 17 00:00:00 2001
From: Elliana May 
Date: Sat, 19 Aug 2023 12:33:00 +0800
Subject: [PATCH 4/8] format script

---
 scripts/generate_docs.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/generate_docs.py b/scripts/generate_docs.py
index eeb1786f0b1..3afc2658e6e 100644
--- a/scripts/generate_docs.py
+++ b/scripts/generate_docs.py
@@ -194,7 +194,11 @@ def add_function(function_prototype, documentation, group):
     docs_string = '\n'
     docs_string += f'### `{function_name}`\n\n'
     docs_string += '---\n'
-    docs_string += docs_str.replace('e.g. ', 'e.g., ').replace('i.e. ', 'i.e., ').strip() +'\n' if docs_str else ''
+    docs_string += (
+        docs_str.replace('e.g. ', 'e.g., ').replace('i.e. ', 'i.e., ').strip() + '\n'
+        if docs_str
+        else ''
+    )
     docs_string += '\n#### Syntax\n\n'
     docs_string += '---\n'
     docs_string += quick_docs_start()

From 5d8c00e24f519261253c4bbf435f939deffe837d Mon Sep 17 00:00:00 2001
From: Elliana May 
Date: Sat, 19 Aug 2023 12:33:30 +0800
Subject: [PATCH 5/8] don't hard fail

---
 scripts/lint.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/lint.sh b/scripts/lint.sh
index b0ca9078784..2f35c84446d 100755
--- a/scripts/lint.sh
+++ b/scripts/lint.sh
@@ -12,9 +12,9 @@ while getopts "f" opt; do
     esac
 done
 
-npx markdownlint-cli docs/ dev/ _posts/ --config .markdownlint.jsonc --ignore docs/archive $fix
+npx markdownlint-cli docs/ dev/ _posts/ --config .markdownlint.jsonc --ignore docs/archive $fix || echo 'mdlit failed'
 
-black scripts --skip-string-normalization $check
+black scripts --skip-string-normalization $check || echo 'black failed'
 
 vale sync
 vale docs/ dev/ _posts/ --glob "!docs/archive/*"

From dc4dce964255578bcf34d62aa28384c66f6948bf Mon Sep 17 00:00:00 2001
From: Elliana May 
Date: Sat, 19 Aug 2023 12:56:10 +0800
Subject: [PATCH 6/8] fix lint.yml

---
 .github/workflows/lint.yml | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 94ff8d47bb1..c58108351c5 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -11,16 +11,13 @@ jobs:
           rm -rf docs/archive
       - uses: errata-ai/vale-action@reviewdog
         with:
-          files: |
-            docs/
-            _posts/
-            dev/
+          files: 'docs/,_posts/,dev/'
           filter_mode: added
           fail_on_error: false
       - uses: articulate/actions-markdownlint@main
         with:
           config: .markdownlint.jsonc
-          files: 'docs/**/*.md'
+          files: 'docs/**/*.md _posts/*.md dev/*.md'
 
   python:
     runs-on: ubuntu-latest

From e650ceae9141ef1fbf3be38e7286a3408e17c935 Mon Sep 17 00:00:00 2001
From: Elliana May 
Date: Sat, 19 Aug 2023 12:59:31 +0800
Subject: [PATCH 7/8] set sep

---
 .github/workflows/lint.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index c58108351c5..1d2a7095840 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -12,6 +12,7 @@ jobs:
       - uses: errata-ai/vale-action@reviewdog
         with:
           files: 'docs/,_posts/,dev/'
+          separator: ","
           filter_mode: added
           fail_on_error: false
       - uses: articulate/actions-markdownlint@main

From e098cdd9c76b5669cf62ac45b188b8c39e3d77df Mon Sep 17 00:00:00 2001
From: Elliana May 
Date: Sat, 19 Aug 2023 14:36:14 +0800
Subject: [PATCH 8/8] undo workflow changes

---
 .github/workflows/lint.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 1d2a7095840..168b3c5cb6e 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -18,7 +18,9 @@ jobs:
       - uses: articulate/actions-markdownlint@main
         with:
           config: .markdownlint.jsonc
-          files: 'docs/**/*.md _posts/*.md dev/*.md'
+          files: 'docs/**/*.md'
+          # TODO:
+          # files: 'docs/**/*.md _posts/*.md dev/*.md'
 
   python:
     runs-on: ubuntu-latest