Skip to content

Commit

Permalink
Deploy R + httr2 (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
verhovsky authored Jul 16, 2024
1 parent 61ce8ba commit c739d60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
11 changes: 8 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ <h2>Language:</h2>
<option value="powershell-webrequest">PowerShell + Invoke-WebRequest</option>
<option value="python" selected>Python + Requests</option>
<option value="python-httpclient">Python + http.client</option>
<option value="r">R</option>
<option value="r">R + httr</option>
<option value="r-httr2">R + httr2</option>
<option value="ruby">Ruby</option>
<option value="rust">Rust</option>
<option value="swift">Swift</option>
Expand Down Expand Up @@ -227,8 +228,12 @@ <h2>Language:</h2>
<li><a class="dropdown-item" href="/python-httpclient/">http.client</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="/r/">R</a>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">R</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/r/">httr</a></li>
<li><a class="dropdown-item" href="/r-httr2/">httr2</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="/ruby/">Ruby</a>
Expand Down
3 changes: 2 additions & 1 deletion languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export const languages = {
'powershell-webrequest': { converter: curlconverter.toPowershellWebRequestWarn, hljs: 'powershell', title: 'PowerShell + Invoke-WebRequest', shortTitle: 'PowerShell' },
python: { converter: curlconverter.toPythonWarn, hljs: 'python', title: 'Python' },
'python-httpclient': { converter: curlconverter.toPythonHttpWarn, hljs: 'python', title: 'Python + http.client' },
r: { converter: curlconverter.toRWarn, hljs: 'r', title: 'R' },
r: { converter: curlconverter.toRWarn, hljs: 'r', title: 'R + httr' },
'r-httr2': { converter: curlconverter.toRHttr2Warn, hljs: 'r', title: 'R + httr2' },
ruby: { converter: curlconverter.toRubyWarn, hljs: 'ruby', title: 'Ruby' },
rust: { converter: curlconverter.toRustWarn, hljs: 'rust', title: 'Rust' },
swift: { converter: curlconverter.toSwiftWarn, hljs: 'swift', title: 'Swift' },
Expand Down
2 changes: 2 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const toLanguage = (language, title, converter, hljsLang) => {
return newContent.replace('<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">PowerShell</a>', '<a class="nav-link dropdown-toggle active" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">PowerShell</a>')
} else if (['python', 'python-httpclient'].includes(language)) {
return newContent.replace('<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Python</a>', '<a class="nav-link dropdown-toggle active" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Python</a>')
} else if (['r', 'r-httr2'].includes(language)) {
return newContent.replace('<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">R</a>', '<a class="nav-link dropdown-toggle active" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">R</a>')
} else {
return newContent.replace(`<a class="nav-link" href="/${language}/"`, `<a class="nav-link active" href="/${language}/"`)
}
Expand Down

0 comments on commit c739d60

Please sign in to comment.