examples/api-samples/public/docs/sample20.html in groupdocs-1.6.0 vs examples/api-samples/public/docs/sample20.html in groupdocs-1.7.0

- old
+ new

@@ -29,13 +29,13 @@ </div> <p>GET request</p> </div> - <div class="content"><div class='highlight'><pre>get <span class="string">'/sample20'</span> <span class="keyword">do</span> - haml <span class="symbol">:sample20</span> -<span class="keyword">end</span></pre></div></div> + <div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-20-how-to-get-compare-change-list-for-document'</span> <span class="hljs-keyword">do</span> + haml <span class="hljs-symbol">:sample20</span> +<span class="hljs-keyword">end</span></pre></div></div> </li> <li id="section-2"> @@ -46,11 +46,11 @@ </div> <p>POST request</p> </div> - <div class="content"><div class='highlight'><pre>post <span class="string">'/sample20'</span> <span class="keyword">do</span></pre></div></div> + <div class="content"><div class='highlight'><pre>post <span class="hljs-string">'/sample-20-how-to-get-compare-change-list-for-document'</span> <span class="hljs-keyword">do</span></pre></div></div> </li> <li id="section-3"> @@ -61,16 +61,16 @@ </div> <p>Set variables</p> </div> - <div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>] - set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>] - set <span class="symbol">:resultFileId</span>, params[<span class="symbol">:resultFileId</span>] - set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>] + <div class="content"><div class='highlight'><pre> set <span class="hljs-symbol">:client_id</span>, params[<span class="hljs-symbol">:clientId</span>] + set <span class="hljs-symbol">:private_key</span>, params[<span class="hljs-symbol">:privateKey</span>] + set <span class="hljs-symbol">:resultFileId</span>, params[<span class="hljs-symbol">:resultFileId</span>] + set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>] - <span class="keyword">begin</span></pre></div></div> + <span class="hljs-keyword">begin</span></pre></div></div> </li> <li id="section-4"> @@ -81,11 +81,11 @@ </div> <p>Check required variables</p> </div> - <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.resultFileId.empty?</pre></div></div> + <div class="content"><div class='highlight'><pre> raise <span class="hljs-string">'Please enter all required parameters'</span> <span class="hljs-keyword">if</span> settings.client_id.empty? <span class="hljs-keyword">or</span> settings.private_key.empty? <span class="hljs-keyword">or</span> settings.resultFileId.empty?</pre></div></div> </li> <li id="section-5"> @@ -96,17 +96,17 @@ </div> <p>Prepare base path</p> </div> - <div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty? - base_path = <span class="string">'https://api.groupdocs.com'</span> - <span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>) - base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>] - <span class="keyword">else</span> + <div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty? + base_path = <span class="hljs-string">'https://api.groupdocs.com'</span> + <span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>) + base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>] + <span class="hljs-keyword">else</span> base_path = settings.base_path - <span class="keyword">end</span></pre></div></div> + <span class="hljs-keyword">end</span></pre></div></div> </li> <li id="section-6"> @@ -117,11 +117,11 @@ </div> <p>Configure your access to API server</p> </div> - <div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs| + <div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs| groupdocs.client_id = settings.client_id groupdocs.private_key = settings.private_key</pre></div></div> </li> @@ -134,12 +134,12 @@ </div> <p>Optionally specify API server and version</p> </div> - <div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span> - <span class="keyword">end</span></pre></div></div> + <div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment"># default is 'https://api.groupdocs.com'</span> + <span class="hljs-keyword">end</span></pre></div></div> </li> <li id="section-8"> @@ -150,11 +150,11 @@ </div> <p>Construct new storage file</p> </div> - <div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.new(<span class="symbol">guid:</span> settings.resultFileId)</pre></div></div> + <div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.new(<span class="hljs-symbol">guid:</span> settings.resultFileId)</pre></div></div> </li> <li id="section-9"> @@ -165,11 +165,11 @@ </div> <p>Construct new document</p> </div> - <div class="content"><div class='highlight'><pre> document = <span class="constant">GroupDocs::Document</span>.new(<span class="symbol">file:</span> file)</pre></div></div> + <div class="content"><div class='highlight'><pre> document = <span class="hljs-constant">GroupDocs::Document</span>.new(<span class="hljs-symbol">file:</span> file)</pre></div></div> </li> <li id="section-10"> @@ -181,32 +181,32 @@ <p>Get compare changes</p> </div> <div class="content"><div class='highlight'><pre> changes = document.changes!() - result = <span class="string">''</span> - result += <span class="string">"&lt;table class='border'&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;&lt;font color='green'&gt;Change Name&lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font color='green'&gt;Change&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"</span> - changes.each <span class="keyword">do</span> |change| - result += <span class="string">"&lt;tr&gt;&lt;td&gt;id&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.id}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;type&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.type}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;text&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.text}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;page id&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.page[<span class="symbol">:Id</span>]}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;page weight&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.page[<span class="symbol">:Width</span>]}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;page height&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.page[<span class="symbol">:Height</span>]}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;box x&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.box.x}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;box y&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.box.y}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;box weight&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.box.width}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr&gt;&lt;td&gt;box height&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.box.height}</span>&lt;/td&gt;&lt;/tr&gt;"</span> - result += <span class="string">"&lt;tr bgcolor='#808080'&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;"</span> - <span class="keyword">end</span> + result = <span class="hljs-string">''</span> + result += <span class="hljs-string">"&lt;table class='border'&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;&lt;font color='green'&gt;Change Name&lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font color='green'&gt;Change&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"</span> + changes.each <span class="hljs-keyword">do</span> |change| + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;id&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.id}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;type&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.type}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;text&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.text}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;page id&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.page[<span class="hljs-symbol">:Id</span>]}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;page weight&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.page[<span class="hljs-symbol">:Width</span>]}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;page height&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.page[<span class="hljs-symbol">:Height</span>]}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;box x&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.box.x}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;box y&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.box.y}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;box weight&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.box.width}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr&gt;&lt;td&gt;box height&lt;/td&gt;&lt;td&gt;<span class="hljs-subst">#{change.box.height}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="hljs-string">"&lt;tr bgcolor='#808080'&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;"</span> + <span class="hljs-keyword">end</span> - result += <span class="string">'&lt;/table&gt;'</span> + result += <span class="hljs-string">'&lt;/table&gt;'</span> - <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e + <span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> =&gt; e err = e.message - <span class="keyword">end</span></pre></div></div> + <span class="hljs-keyword">end</span></pre></div></div> </li> <li id="section-11"> @@ -217,11 +217,11 @@ </div> <p>Set variables for template</p> </div> - <div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample20</span>, <span class="symbol">:locals</span> =&gt; {<span class="symbol">:userId</span> =&gt; settings.client_id, <span class="symbol">:privateKey</span> =&gt; settings.private_key, <span class="symbol">:resultFileId</span> =&gt; settings.resultFileId, <span class="symbol">:result</span> =&gt; result, <span class="symbol">:err</span> =&gt; err} -<span class="keyword">end</span></pre></div></div> + <div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample20</span>, <span class="hljs-symbol">:locals</span> =&gt; {<span class="hljs-symbol">:userId</span> =&gt; settings.client_id, <span class="hljs-symbol">:privateKey</span> =&gt; settings.private_key, <span class="hljs-symbol">:resultFileId</span> =&gt; settings.resultFileId, <span class="hljs-symbol">:result</span> =&gt; result, <span class="hljs-symbol">:err</span> =&gt; err} +<span class="hljs-keyword">end</span></pre></div></div> </li> </ul> </div>