@@ -23,46 +23,6 @@ see README at root of repo for usage details
2323
2424---
2525
26- ## Members
27-
28- <dl >
29- <dt ><a href =" #DEV-Post-Declarative-Shadow-DOM " >DEV-Post-Declarative-Shadow-DOM</a > ⇒ <code >string</code ></dt >
30- <dd ></dd >
31- <dt ><a href =" #DEV-Declarative-Shadow-DOM " >DEV-Declarative-Shadow-DOM</a > ⇒ <code >string</code ></dt >
32- <dd ></dd >
33- </dl >
34-
35- ## Objects
36-
37- <dl >
38- <dt ><a href =" #DEVUtils " >DEVUtils</a > : <code >object</code ></dt >
39- <dd ><p >Utility functions for fetching and parsing dev.to api data, getting
40- styles and generating HTML for dev.to profile UIs</p >
41- </dd >
42- </dl >
43-
44- <a name =" DEV-Post-Declarative-Shadow-DOM " ></a >
45-
46- ## DEV-Post-Declarative-Shadow-DOM ⇒ <code >string</code >
47- ** Kind** : global variable
48- ** Returns** : <code >string</code > - DEV post HTML wrapped in a ` template `
49-
50- | Param | Type | Description |
51- | --- | --- | --- |
52- | content | <code >ForemPostHTML</code > | Content about one post by dev.to (or Forem) user |
53- | fetch | <code >boolean</code > | |
54-
55- <a name =" DEV-Declarative-Shadow-DOM " ></a >
56-
57- ## DEV-Declarative-Shadow-DOM ⇒ <code >string</code >
58- ** Kind** : global variable
59- ** Returns** : <code >string</code > - DEV HTML wrapped in a ` template `
60-
61- | Param | Type | Description |
62- | --- | --- | --- |
63- | content | <code >ForemUserHTML</code > | a content object representing a DEV user |
64- | fetch | <code >boolean</code > | |
65-
6626<a name =" DEVUtils " ></a >
6727
6828## DEVUtils : <code >object</code >
@@ -74,6 +34,7 @@ Utility functions for fetching and parsing dev.to api data, getting
7434
7535* [ DEVUtils] ( #DEVUtils ) : <code >object</code >
7636 * [ .post] ( #DEVUtils.post ) : <code >object</code >
37+ * [ .dsd] ( #DEVUtils.post.dsd ) ⇒ <code >string</code >
7738 * [ .html(content)] ( #DEVUtils.post.html ) ⇒ <code >string</code >
7839 * [ .generateContent(content, [ fetch] )] ( #DEVUtils.post.generateContent ) ⇒ <code >ForemPost</code > \| <code >ForemError</code >
7940 * [ .ForemPost] ( #DEVUtils.post.ForemPost ) : <code >Object</code >
@@ -82,6 +43,7 @@ Utility functions for fetching and parsing dev.to api data, getting
8243 * [ .styles] ( #DEVUtils.user.styles )
8344 * [ .html(content)] ( #DEVUtils.user.html ) ⇒ <code >string</code >
8445 * [ .generateContent(content, [ fetch] )] ( #DEVUtils.user.generateContent ) ⇒ <code >ForemUserHTML</code >
46+ * [ .dsd(content, fetch)] ( #DEVUtils.user.dsd ) ⇒ <code >string</code >
8547 * [ .ForemUser] ( #DEVUtils.user.ForemUser ) : <code >Object</code >
8648 * [ .ForemUserHTML] ( #DEVUtils.user.ForemUserHTML ) : <code >ForemUser</code >
8749
@@ -91,6 +53,27 @@ Utility functions for fetching and parsing dev.to api data, getting
9153Utility functions for a post
9254
9355** Kind** : static namespace of [ <code >DEVUtils</code >] ( #DEVUtils )
56+
57+ * [ .post] ( #DEVUtils.post ) : <code >object</code >
58+ * [ .dsd] ( #DEVUtils.post.dsd ) ⇒ <code >string</code >
59+ * [ .html(content)] ( #DEVUtils.post.html ) ⇒ <code >string</code >
60+ * [ .generateContent(content, [ fetch] )] ( #DEVUtils.post.generateContent ) ⇒ <code >ForemPost</code > \| <code >ForemError</code >
61+ * [ .ForemPost] ( #DEVUtils.post.ForemPost ) : <code >Object</code >
62+ * [ .ForemPostHTML] ( #DEVUtils.post.ForemPostHTML ) : <code >ForemPost</code >
63+
64+ <a name =" DEVUtils.post.dsd " ></a >
65+
66+ #### post.dsd ⇒ <code >string</code >
67+ Generate a ` template ` element with a shadowdom with a Post in it
68+
69+ ** Kind** : static namespace of [ <code >post</code >] ( #DEVUtils.post )
70+ ** Returns** : <code >string</code > - DEV post HTML wrapped in a ` template `
71+
72+ | Param | Type | Description |
73+ | --- | --- | --- |
74+ | content | <code >ForemPostHTML</code > | Content about one post by dev.to (or Forem) user |
75+ | fetch | <code >boolean</code > | |
76+
9477** Example** * (Server side rendering a post with Declarative Shadow Dom)*
9578``` js
9679< devto- post>< / devto- post>
@@ -101,13 +84,6 @@ const dsdHTML = post.dsd({id: '12345'}, true);
10184document .querySelector (' devto-post' ).innerHTML = dsdHTML;
10285< / script>
10386```
104-
105- * [ .post] ( #DEVUtils.post ) : <code >object</code >
106- * [ .html(content)] ( #DEVUtils.post.html ) ⇒ <code >string</code >
107- * [ .generateContent(content, [ fetch] )] ( #DEVUtils.post.generateContent ) ⇒ <code >ForemPost</code > \| <code >ForemError</code >
108- * [ .ForemPost] ( #DEVUtils.post.ForemPost ) : <code >Object</code >
109- * [ .ForemPostHTML] ( #DEVUtils.post.ForemPostHTML ) : <code >ForemPost</code >
110-
11187<a name =" DEVUtils.post.html " ></a >
11288
11389#### post.html(content) ⇒ <code >string</code >
@@ -168,21 +144,12 @@ Forem post content, ready for HTML
168144Utility functions for a user
169145
170146** Kind** : static namespace of [ <code >DEVUtils</code >] ( #DEVUtils )
171- ** Example** * (Server side rendering with Declarative Shadow Dom)*
172- ``` js
173- < devto- user>< / devto- user>
174-
175- < script type= " module" >
176- import {dsd } from ' profile-components/devto-utils' ;
177- const dsdHTML = dsd ({username: ' scottnath' }, true );
178- document .querySelector (' devto-user' ).innerHTML = dsdHTML;
179- < / script>
180- ```
181147
182148* [ .user] ( #DEVUtils.user ) : <code >object</code >
183149 * [ .styles] ( #DEVUtils.user.styles )
184150 * [ .html(content)] ( #DEVUtils.user.html ) ⇒ <code >string</code >
185151 * [ .generateContent(content, [ fetch] )] ( #DEVUtils.user.generateContent ) ⇒ <code >ForemUserHTML</code >
152+ * [ .dsd(content, fetch)] ( #DEVUtils.user.dsd ) ⇒ <code >string</code >
186153 * [ .ForemUser] ( #DEVUtils.user.ForemUser ) : <code >Object</code >
187154 * [ .ForemUserHTML] ( #DEVUtils.user.ForemUserHTML ) : <code >ForemUser</code >
188155
@@ -217,6 +184,29 @@ Generates an object of content for the user HTML
217184| content | <code >ForemUserHTML</code > |
218185| [ fetch] | <code >boolean</code > |
219186
187+ <a name =" DEVUtils.user.dsd " ></a >
188+
189+ #### user.dsd(content, fetch) ⇒ <code >string</code >
190+ Generate a ` template ` element with shadowrootmode with a User in it
191+
192+ ** Kind** : static method of [ <code >user</code >] ( #DEVUtils.user )
193+ ** Returns** : <code >string</code > - DEV HTML wrapped in a ` template `
194+
195+ | Param | Type | Description |
196+ | --- | --- | --- |
197+ | content | <code >ForemUserHTML</code > | a content object representing a DEV user |
198+ | fetch | <code >boolean</code > | |
199+
200+ ** Example** * (Server side rendering with Declarative Shadow Dom)*
201+ ``` js
202+ < devto- user>< / devto- user>
203+
204+ < script type= " module" >
205+ import {dsd } from ' profile-components/devto-utils' ;
206+ const dsdHTML = dsd ({username: ' scottnath' }, true );
207+ document .querySelector (' devto-user' ).innerHTML = dsdHTML;
208+ < / script>
209+ ```
220210<a name =" DEVUtils.user.ForemUser " ></a >
221211
222212#### user.ForemUser : <code >Object</code >
0 commit comments