diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml new file mode 100644 index 0000000..8cb4a60 --- /dev/null +++ b/.github/workflows/render-readme.yaml @@ -0,0 +1,60 @@ +on: + workflow_dispatch: + inputs: + turma: + description: 'turma: codigo da turma. ex: 202110-r4ds-1' + required: true + default: '202110-r4ds-1' + nome_curso: + description: 'nome_curso: Nome do curso' + required: true + default: 'R para Ciência de Dados 1' + download_material: + description: 'download_material: TRUE ou FALSE, se o curso tem zip para baixar' + required: true + default: 'TRUE' + +name: render-readme + +jobs: + render-readme: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v3 + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + - uses: r-lib/actions/setup-pandoc@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + cache-version: 2 + packages: + any::knitr + any::rmarkdown + any::fs + any::tibble + any::dplyr + any::glue + any::readr + github::curso-r/CursoRopen + + - name: Execute Script + env: + TURMA: ${{ github.event.inputs.turma }} + NOME_CURSO: ${{ github.event.inputs.nome_curso }} + DOWNLOAD_MATERIAL: ${{ github.event.inputs.download_material }} + run: | + Rscript "assets/render_readme.R" + + - name: Commit results + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add README.Rmd + git add README.md + git add _config.yml + git commit -m "Atualizando README" || echo "No changes to commit" + git push origin || echo "No changes to commit" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4cc09cc --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata +README.html diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..78c9e1f --- /dev/null +++ b/README.Rmd @@ -0,0 +1,148 @@ +--- +output: github_document +params: + turma: 202102-intro-programacao + nome_curso: ATUALIZANDO.... + download_material: 'TRUE' +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set(collapse = TRUE, comment = "#>", echo = FALSE, + warning = FALSE, message = FALSE) + +path_to_url <- function(path) { + path |> + tibble::tibble(file = _) |> + dplyr::mutate( + url = file |> + paste0("https://curso-r.github.io/", params$turma, "/", ... = _) |> + paste0("[", fs::path_file(file), "](", ... = _, ")") + ) |> + dplyr::select(url) +} +``` + +## Informações importantes + +```{r results = 'asis'} +# Baixar o ZIP do repo da turma (o repo principal não vai ter os scripts feitos em aula) +if (params$download_material == "TRUE") { + glue::glue("- [Clique aqui](https://github.com/curso-r/{params$turma}/archive/refs/heads/main.zip) para baixar o material do curso.") +} +``` + +- Nosso blog: [https://curso-r.com/blog/](https://curso-r.com/blog/) + +- Nosso fórum: [https://discourse.curso-r.com/](https://discourse.curso-r.com/) + +- Nossos livros: + - [Ciência de Dados em R](https://livro.curso-r.com/) + - [Zen do R](https://curso-r.github.io/zen-do-r/) + - [Programando em Shiny](https://programando-em-shiny.curso-r.com/) + - [Beautiful R](https://curso-r.github.io/beautiful-r/) (em inglês) + + + +## Dúvidas + +Fora do horário de aula ou monitoria: + +- Perguntas gerais sobre o curso deverão ser feitas no Classroom. + +- Perguntas sobre R, principalmente as que envolverem código, deverão ser enviadas no [nosso fórum](https://discourse.curso-r.com/). + +## Slides + +```{r} +"slides/" |> + fs::dir_ls(glob = "*.html", fail = FALSE) |> + path_to_url() |> + dplyr::select(Slide = url) |> + knitr::kable() +``` + + +## Scripts utilizados em aula + +```{r} +"exemplos_de_aula/" |> + fs::dir_ls(fail = FALSE) |> + path_to_url() |> + dplyr::select(Exemplo = url) |> + knitr::kable() +``` +## Práticas + +```{r} +"praticas/" |> + fs::dir_ls(fail = FALSE) |> + path_to_url() |> + dplyr::select(Exemplo = url) |> + knitr::kable() +``` + +## Lição de casa + +```{r} +"exercicios/" |> + fs::dir_ls(fail = FALSE) |> + path_to_url() |> + dplyr::select(Exercício = url) |> + knitr::kable() +``` + + +## Material extra + +Referências extras relacionadas com o conteúdos das aulas, ou materiais que +comentamos quando tiramos dúvidas (não necessariamente são relacionadas com o +conteúdo da aula). + + +```{r echo=FALSE, message=FALSE, warning=FALSE} +arquivo_csv_materiais <- "extras.csv" +if (file.exists(arquivo_csv_materiais)) { + arquivo_csv_materiais |> + readr::read_csv2(show_col_types = FALSE) |> + knitr::kable() +} else { + cat("Em breve!") +} +``` + +## Redes sociais da Curso-R + +- Youtube: https://www.youtube.com/c/CursoR6/featured + +- Instagram: https://www.instagram.com/cursoo_r/ + +- Twitter: https://twitter.com/curso_r + +- Linkedin: https://www.linkedin.com/company/curso-r/ + +- Facebook: https://www.facebook.com/cursodeR + +```{r include = FALSE} +# Criar arquivo _config.yml +if (params$download_material == TRUE) { + content <- glue::glue( + "theme: jekyll-theme-minimal", "\n", + "logo: assets/logo.png", "\n", + "title: {params$nome_curso}", "\n", + "show_downloads: true", "\n", + "link_material: 'https://github.com/curso-r/{params$turma}/archive/refs/heads/main.zip'", + "\n" + ) +} else { + content <- glue::glue( + "theme: jekyll-theme-minimal", "\n", + "logo: assets/logo.png", "\n", + "title: {params$nome_curso}", "\n", + "show_downloads: false", "\n" + ) +} + +readr::write_lines(content, "_config.yml") +``` diff --git a/README.md b/README.md new file mode 100644 index 0000000..749e217 --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ + + + +## Informações importantes + +- [Clique + aqui](https://github.com/curso-r/202102-intro-programacao/archive/refs/heads/main.zip) + para baixar o material do curso. + +- Nosso blog: + +- Nosso fórum: + +- Nossos livros: + + - [Ciência de Dados em R](https://livro.curso-r.com/) + - [Zen do R](https://curso-r.github.io/zen-do-r/) + - [Programando em + Shiny](https://programando-em-shiny.curso-r.com/) + - [Beautiful R](https://curso-r.github.io/beautiful-r/) (em + inglês) + +## Dúvidas + +Fora do horário de aula ou monitoria: + +- Perguntas gerais sobre o curso deverão ser feitas no Classroom. + +- Perguntas sobre R, principalmente as que envolverem código, deverão + ser enviadas no [nosso fórum](https://discourse.curso-r.com/). + +## Slides + +| Slide | +|:------| + +## Scripts utilizados em aula + +| Exemplo | +|:--------| + +## Práticas + +| Exemplo | +|:--------| + +## Lição de casa + +| Exercício | +|:----------| + +## Material extra + +Referências extras relacionadas com o conteúdos das aulas, ou materiais +que comentamos quando tiramos dúvidas (não necessariamente são +relacionadas com o conteúdo da aula). + + #> Em breve! + +## Redes sociais da Curso-R + +- Youtube: + +- Instagram: + +- Twitter: + +- Linkedin: + +- Facebook: diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..edc739f --- /dev/null +++ b/_config.yml @@ -0,0 +1,5 @@ +theme: jekyll-theme-minimal +logo: assets/logo.png +title: ATUALIZANDO.... +show_downloads: true +link_material: 'https://github.com/curso-r/202102-intro-programacao/archive/refs/heads/main.zip' diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..366bc85 --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,61 @@ + + + + + + + +{% seo %} + + + + + +
+
+ {% if site.logo %} + Logo + {% endif %} + +

{{ site.description | default: site.github.project_tagline }}

+ + {% if site.show_downloads %} + + {% endif %} + +
+ +
+ + +
+
+ +

{{ site.title | default: site.github.repository_name }}

+ + {{ content }} + +
+ +
+ + {% if site.google_analytics %} + + {% endif %} + + diff --git a/assets/css/fonts.css b/assets/css/fonts.css new file mode 100644 index 0000000..fa84901 --- /dev/null +++ b/assets/css/fonts.css @@ -0,0 +1,55 @@ +@font-face { + font-family: 'Noto Sans'; + font-weight: 400; + font-style: normal; + src: url('../fonts/Noto-Sans-regular/Noto-Sans-regular.eot'); + src: url('../fonts/Noto-Sans-regular/Noto-Sans-regular.eot?#iefix') format('embedded-opentype'), + local('Noto Sans'), + local('Noto-Sans-regular'), + url('../fonts/Noto-Sans-regular/Noto-Sans-regular.woff2') format('woff2'), + url('../fonts/Noto-Sans-regular/Noto-Sans-regular.woff') format('woff'), + url('../fonts/Noto-Sans-regular/Noto-Sans-regular.ttf') format('truetype'), + url('../fonts/Noto-Sans-regular/Noto-Sans-regular.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: 'Noto Sans'; + font-weight: 700; + font-style: normal; + src: url('../fonts/Noto-Sans-700/Noto-Sans-700.eot'); + src: url('../fonts/Noto-Sans-700/Noto-Sans-700.eot?#iefix') format('embedded-opentype'), + local('Noto Sans Bold'), + local('Noto-Sans-700'), + url('../fonts/Noto-Sans-700/Noto-Sans-700.woff2') format('woff2'), + url('../fonts/Noto-Sans-700/Noto-Sans-700.woff') format('woff'), + url('../fonts/Noto-Sans-700/Noto-Sans-700.ttf') format('truetype'), + url('../fonts/Noto-Sans-700/Noto-Sans-700.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: 'Noto Sans'; + font-weight: 400; + font-style: italic; + src: url('../fonts/Noto-Sans-italic/Noto-Sans-italic.eot'); + src: url('../fonts/Noto-Sans-italic/Noto-Sans-italic.eot?#iefix') format('embedded-opentype'), + local('Noto Sans Italic'), + local('Noto-Sans-italic'), + url('../fonts/Noto-Sans-italic/Noto-Sans-italic.woff2') format('woff2'), + url('../fonts/Noto-Sans-italic/Noto-Sans-italic.woff') format('woff'), + url('../fonts/Noto-Sans-italic/Noto-Sans-italic.ttf') format('truetype'), + url('../fonts/Noto-Sans-italic/Noto-Sans-italic.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: 'Noto Sans'; + font-weight: 700; + font-style: italic; + src: url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.eot'); + src: url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.eot?#iefix') format('embedded-opentype'), + local('Noto Sans Bold Italic'), + local('Noto-Sans-700italic'), + url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff2') format('woff2'), + url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff') format('woff'), + url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.ttf') format('truetype'), + url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.svg#NotoSans') format('svg'); +} \ No newline at end of file diff --git a/assets/css/rouge-github.css b/assets/css/rouge-github.css new file mode 100644 index 0000000..e3ff0c8 --- /dev/null +++ b/assets/css/rouge-github.css @@ -0,0 +1,209 @@ +.highlight table td { padding: 5px; } +.highlight table pre { margin: 0; } +.highlight .cm { + color: #999988; + font-style: italic; +} +.highlight .cp { + color: #999999; + font-weight: bold; +} +.highlight .c1 { + color: #999988; + font-style: italic; +} +.highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; +} +.highlight .c, .highlight .cd { + color: #999988; + font-style: italic; +} +.highlight .err { + color: #a61717; + background-color: #e3d2d2; +} +.highlight .gd { + color: #000000; + background-color: #ffdddd; +} +.highlight .ge { + color: #000000; + font-style: italic; +} +.highlight .gr { + color: #aa0000; +} +.highlight .gh { + color: #999999; +} +.highlight .gi { + color: #000000; + background-color: #ddffdd; +} +.highlight .go { + color: #888888; +} +.highlight .gp { + color: #555555; +} +.highlight .gs { + font-weight: bold; +} +.highlight .gu { + color: #aaaaaa; +} +.highlight .gt { + color: #aa0000; +} +.highlight .kc { + color: #000000; + font-weight: bold; +} +.highlight .kd { + color: #000000; + font-weight: bold; +} +.highlight .kn { + color: #000000; + font-weight: bold; +} +.highlight .kp { + color: #000000; + font-weight: bold; +} +.highlight .kr { + color: #000000; + font-weight: bold; +} +.highlight .kt { + color: #445588; + font-weight: bold; +} +.highlight .k, .highlight .kv { + color: #000000; + font-weight: bold; +} +.highlight .mf { + color: #009999; +} +.highlight .mh { + color: #009999; +} +.highlight .il { + color: #009999; +} +.highlight .mi { + color: #009999; +} +.highlight .mo { + color: #009999; +} +.highlight .m, .highlight .mb, .highlight .mx { + color: #009999; +} +.highlight .sb { + color: #d14; +} +.highlight .sc { + color: #d14; +} +.highlight .sd { + color: #d14; +} +.highlight .s2 { + color: #d14; +} +.highlight .se { + color: #d14; +} +.highlight .sh { + color: #d14; +} +.highlight .si { + color: #d14; +} +.highlight .sx { + color: #d14; +} +.highlight .sr { + color: #009926; +} +.highlight .s1 { + color: #d14; +} +.highlight .ss { + color: #990073; +} +.highlight .s { + color: #d14; +} +.highlight .na { + color: #008080; +} +.highlight .bp { + color: #999999; +} +.highlight .nb { + color: #0086B3; +} +.highlight .nc { + color: #445588; + font-weight: bold; +} +.highlight .no { + color: #008080; +} +.highlight .nd { + color: #3c5d5d; + font-weight: bold; +} +.highlight .ni { + color: #800080; +} +.highlight .ne { + color: #990000; + font-weight: bold; +} +.highlight .nf { + color: #990000; + font-weight: bold; +} +.highlight .nl { + color: #990000; + font-weight: bold; +} +.highlight .nn { + color: #555555; +} +.highlight .nt { + color: #000080; +} +.highlight .vc { + color: #008080; +} +.highlight .vg { + color: #008080; +} +.highlight .vi { + color: #008080; +} +.highlight .nv { + color: #008080; +} +.highlight .ow { + color: #000000; + font-weight: bold; +} +.highlight .o { + color: #000000; + font-weight: bold; +} +.highlight .w { + color: #bbbbbb; +} +.highlight { + background-color: #f8f8f8; +} \ No newline at end of file diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..e3652be --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,290 @@ +@import "fonts"; +@import "rouge-github"; + +body { + background-color: #fff; + padding:50px; + font: 14px/1.5 "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + color:#727272; + font-weight:400; +} + +h1, h2, h3, h4, h5, h6 { + color:#222; + margin:0 0 20px; +} + +p, ul, ol, table, pre, dl { + margin:0 0 20px; +} + +h1, h2, h3 { + line-height:1.1; +} + +h1 { + font-size:28px; +} + +h2 { + color:#393939; + border-bottom: 2px solid #b9b3b3; + padding-bottom: 10px; + margin-top: 70px; +} + +h3, h4, h5, h6 { + color:#494949; + margin-bottom: 20px; + margin-top: 30px; +} + +li > p { + margin-bottom: 5px; +} + +a { + color:#267CB9; + text-decoration:none; +} + +a:hover, a:focus { + color:#069; + font-weight: bold; +} + +a small { + font-size:11px; + color:#777; + margin-top:-0.3em; + display:block; +} + +a:hover small { + color:#777; +} + +.wrapper { + width:860px; + margin:0 auto; +} + +blockquote { + border-left:1px solid #e5e5e5; + margin:0; + padding:0 0 0 20px; + font-style:italic; +} + +code, pre { + font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal, Consolas, Liberation Mono, DejaVu Sans Mono, Courier New, monospace; + color:#333; +} + +pre { + padding:8px 15px; + background: #f8f8f8; + border-radius:5px; + border:1px solid #e5e5e5; + overflow-x: auto; +} + +table { + width:100%; + border-collapse:collapse; +} + +th, td { + text-align:left; + padding:5px 10px; + border-bottom:1px solid #e5e5e5; +} + +dt { + color:#444; + font-weight:700; +} + +th { + color:#444; +} + +img { + max-width:100%; +} + +header { + width:270px; + float:left; + position:fixed; + -webkit-font-smoothing:subpixel-antialiased; +} + +ul.downloads { + list-style:none; + height:40px; + padding:0; + background: #f4f4f4; + border-radius:5px; + border:1px solid #e0e0e0; + width:270px; +} + +.downloads li { + width:89px; + float:left; + border-right:1px solid #e0e0e0; + height:40px; +} + +.downloads li:first-child a { + border-radius:5px 0 0 5px; +} + +.downloads li:last-child a { + border-radius:0 5px 5px 0; +} + +.downloads a { + line-height:1; + font-size:11px; + color:#676767; + display:block; + text-align:center; + padding-top:6px; + height:34px; +} + +.downloads a:hover, .downloads a:focus { + color:#675C5C; + font-weight:bold; +} + +.downloads ul a:active { + background-color:#f0f0f0; +} + +strong { + color:#222; + font-weight:700; +} + +.downloads li + li + li { + border-right:none; + width:89px; +} + +.downloads a strong { + font-size:14px; + display:block; + color:#222; +} + +section { + width:500px; + float:right; + padding-bottom:50px; +} + +small { + font-size:11px; +} + +hr { + border:0; + background:#e5e5e5; + height:1px; + margin:0 0 20px; +} + +footer { + width:270px; + float:left; + position:fixed; + bottom:50px; + -webkit-font-smoothing:subpixel-antialiased; +} + +.toc { + margin-top: 40px; + margin-bottom: 30px; +} + +.toc p { + margin-bottom: 5px; +} + +@media print, screen and (max-width: 960px) { + + div.wrapper { + width:auto; + margin:0; + } + + header, section, footer { + float:none; + position:static; + width:auto; + } + + header { + padding-right:320px; + } + + section { + border:1px solid #e5e5e5; + border-width:1px 0; + padding:20px 0; + margin:0 0 20px; + } + + header a small { + display:inline; + } + + header ul { + position:absolute; + right:50px; + top:52px; + } +} + +@media print, screen and (max-width: 720px) { + body { + word-wrap:break-word; + } + + header { + padding:0; + } + + header ul, header p.view { + position:static; + } + + pre, code { + word-wrap:normal; + } +} + +@media print, screen and (max-width: 480px) { + body { + padding:15px; + } + + .downloads { + width:99%; + } + + .downloads li, .downloads li + li + li { + width:33%; + } +} + +@media print { + body { + padding:0.4in; + font-size:12pt; + color:#444; + } +} \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..3c23b92 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,33 @@ +var sectionHeight = function() { + var total = $(window).height(), + $section = $('section').css('height','auto'); + + if ($section.outerHeight(true) < total) { + var margin = $section.outerHeight(true) - $section.height(); + $section.height(total - margin - 20); + } else { + $section.css('height','auto'); + } +} + +$(window).resize(sectionHeight); + +$(function() { + $("section h2").each(function(){ + $("nav ul").append("
  • " + $(this).text() + "
  • "); + $(this).attr("id",$(this).text().toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g,'')); + $("nav ul li:first-child a").parent().addClass("active"); + }); + + $("nav ul li").on("click", "a", function(event) { + var position = $($(this).attr("href")).offset().top - 190; + $("html, body").animate({scrollTop: position}, 400); + $("nav ul li a").parent().removeClass("active"); + $(this).parent().addClass("active"); + event.preventDefault(); + }); + + sectionHeight(); + + $('img').on('load', sectionHeight); +}); \ No newline at end of file diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..85d388f Binary files /dev/null and b/assets/logo.png differ diff --git a/assets/render_readme.R b/assets/render_readme.R new file mode 100644 index 0000000..8646bd5 --- /dev/null +++ b/assets/render_readme.R @@ -0,0 +1,16 @@ +CursoRopen::change_rmd_yaml( + "README.Rmd", + params = list( + turma = Sys.getenv("TURMA"), + nome_curso = Sys.getenv("NOME_CURSO"), + download_material = Sys.getenv("DOWNLOAD_MATERIAL") + ), + new_path = "README.Rmd" +) + +rmarkdown::render( + input = "README.Rmd", + output_format = "github_document", + clean = TRUE, + output_file = "README.md" +) diff --git a/template-pagina-do-curso.Rproj b/template-pagina-do-curso.Rproj new file mode 100644 index 0000000..69fafd4 --- /dev/null +++ b/template-pagina-do-curso.Rproj @@ -0,0 +1,22 @@ +Version: 1.0 + +RestoreWorkspace: No +SaveWorkspace: No +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +AutoAppendNewline: Yes +StripTrailingWhitespace: Yes +LineEndingConversion: Posix + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace