Repository: sdispater/tomlkit

Issue:
Document how to create a table without the supers
I'm trying to create
```toml
[a.b.c]
d = 10
```
but I get
```toml
[a]
[a.b]
[a.b.c]
d = 10
```

Looking around, somethings I see that might be useful
- `tomlkit.items.Table(..., is_super_table)` but am unclear where I apply it and what problems I need to avoid vs what is enforced for me
- `tomlkit.items.Key` supports a type and dotted but it is unclear what should be done.
  - Even if I pass `dotted=True`, it looks like it'll still get a `Basic` type and be quoted.  So I need to specify both `Bare` and `dotted`?

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b6f43ba..a3aab18 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
 # Change Log
 
+## [Unreleased]
+
+### Added
+
+- Add a new argument to `table` API to allow it to be a super table. ([#159](https://github.com/sdispater/tomlkit/pull/159))
+
 ## [0.8.0] - 2021-12-20
 
 ### Changed
diff --git a/tomlkit/api.py b/tomlkit/api.py
index 8a2e8f5..fd4b2f3 100644
--- a/tomlkit/api.py
+++ b/tomlkit/api.py
@@ -129,8 +129,8 @@ def array(raw: str = None) -> Array:
     return value(raw)
 
 
-def table() -> Table:
-    return Table(Container(), Trivia(), False)
+def table(is_super_table: bool = False) -> Table:
+    return Table(Container(), Trivia(), False, is_super_table)
 
 
 def inline_table() -> InlineTable:


Test patch:
diff --git a/tests/test_api.py b/tests/test_api.py
index 5038fda..20e5113 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -283,3 +283,11 @@ def test_item_mixed_aray():
     t = tomlkit.item(example)
     assert t.as_string().strip() == expected
     assert dumps({"x": {"y": example}}).strip() == "[x]\ny = " + expected
+
+
+def test_build_super_table():
+    doc = tomlkit.document()
+    table = tomlkit.table(True)
+    table.add("bar", {"x": 1})
+    doc.add("foo", table)
+    assert doc.as_string() == "[foo.bar]\nx = 1\n"