Drupal 8 Open Social new sub-theme not showing in appearance - drupal

I am working with Drupal's Open social framework where in I copy socialblue theme so that i can do my modifications in the new theme. I followed the below steps, cleared cache, yet I am not able to see my new theme in admin/appearance section.
Steps I followed:
1) I duplicated the theme socialblue (html/profiles/contrib/social/themes/socialblue) to
newtheme (html/profiles/contrib/social/themes/newtheme)
2) I did a search (socialblue) and replace (newtheme) inside of “newtheme” directory
3) I changed the names of the following files from “socialblue” to “newtheme"
newtheme.info.yml
newtheme.libraries.yml
newtheme.theme
config/install/newtheme.settings.yml
4) I created a /html/sites/default/services.yml file from default.services.yml and made the following changes
twig.config -> debug: true
twig.config -> auto_reload: true
twig.config -> cache: false
5) html/profiles/contrib/social/themes/newtheme$ yarn install
6) html/profiles/contrib/social/themes/newtheme$ sudo npm install -g gulp-cli
7) html/profiles/contrib/social/themes/newtheme$ gulp
I do not get any error. I made sure that my newtheme.info file has name newtheme. I also copied this new theme in html/themes/custom/newtheme still no luck. Am I missing something?

I solved it. Turns out it was because my base theme was mentioned as 'socialblue'. I changed it to 'socialbase' and it worked out. I don't know if a parent theme can have more than one child themes in drupal 8.

Related

How are you handling theme updates across multiple Shiny apps?

I have a general shiny question, rather than a specific call to help with code.
I've just finished creating a branded shiny template using a mix of fresh and some custom CSS. It's branded and looks sharp for the dashboards I'm building for my organisation. However, I've got one eye on how to maintain the look and feel of our dashboards as our analytics team continues to grow and mature. When we have 50 apps deployed and we want to change the theme, we will have to go through and update the code in 50 different shinyapps if we continue with the current method of fresh and custom CSS in www/.
Does anyone have experience in centralising themes? Perhaps serving CSS from somewhere external to Shiny and calling that at the start of app.R? This would likely require me to unify fresh and my additional custom CSS into a single .css file, but that's something I'm willing to do.
Alternatively, perhaps someone clever has already developed a package to solve this problem?
Any general pointers warmly received.
For those who might be interested, I built the theme into a package I was developing. Within my package's root dir, I added an inst folder and, inside that, a www dir. I added the organisation logo and some extra CSS that couldn't be easily configured with {fresh}.
To set the theme, I created a function like this:
set_theme<-function(){
theme<-fresh::create_theme(
fresh::adminlte_color(
light_blue = "#383F48",
aqua = "#094357",
green = "#094357",
blue = "#383F48"
),
fresh::adminlte_global(
box_bg = "#FFFFFF",
info_box_bg = "#D1E0E5"
),
fresh::adminlte_vars(
"sidebar-width" = "275px",
"sidebar-dark-bg" = "#3A3F46",
"sidebar-dark-hover-color" = "#FFB151",
"btn-border-radius" = "1px"
)
)
shiny::addResourcePath('www', system.file("www", package = "myPackage"))
return(theme)
}
I used shiny::addResourcePath to create a resource path to link the package's inst/www folder to the project within which myPackage::set_theme() is called. Then, within my Shiny dashboards:
library(myPackage)
theme <- myPackage::set_theme()
ui<-(
fresh::use_theme(theme)
...
tags$head(tags$link(rel = "stylesheet", type = "text/css", href =
"www/style.css"))
...
)
Make note of the www/ in the href argument. If you were to keep these files 'locally' within your Shiny app, you'd create a www dir in root and forego the www/ prefix. When calling files from your package, simply include the www/

Get blogdown on r-blogggers for hugo-goa

I attempt to bring the following blog style blogdown::new_site(theme = "shenoybr/hugo-goa") to r-bloggers.
Following How do I get my blogdown blog on R-Bloggers? seems to be outdated.
A new solution appeared: https://stackoverflow.com/a/63499033/8538074, which i attempted to follow.
dir.create("blog18")
setwd("blog18")
blogdown::new_site(theme = "shenoybr/hugo-goa")
Then follow the answer linked above:
dir.create(path = "layouts/tags")
xx = readLines("https://raw.githubusercontent.com/liao961120/Hugo-RSS/master/layouts/categories/rss.xml")
writeLines(text = xx, con = "layouts/tags/rss.xml")
blogdown::build_site()
Push to github:
go to github and create repo
{GITHUBUSERNAME}.github.io
for me it is TyGu1.github.io
Drag and drop all files in github upload
Check Website:
go to https://tygu1.github.io/
--> Website is up
As suggested in https://www.r-bloggers.com/add-your-blog/
go to
paste0("https://simplepie.org/demo/?feed=", URLencode("https://tygu1.github.io/", reserved = TRUE))
"https://simplepie.org/demo/?feed=https%3A%2F%2Ftygu1.github.io%2F"
RSS feed does not work.
Question:
Which steps do i have to Change for the rss feed to be valid (using the shenoybr/hugo-goa style)
Edit:
As asked/suggested in the question: Github pages seems to activated already:
(In other repos i see "GitHub Pages is currently disabled. ", therefore i assume it is activated in the current repo, see the picture below).
The address of your website is correct but the one of your blog is https://tygu1.github.io/blog.
The XML feed is located at https://tygu1.github.io/blog/index.xml. If you paste it in simplepie.org, it works: https://simplepie.org/demo/?feed=https%3A%2F%2Ftygu1.github.io%2Fblog%2Findex.xml.
So the problem was the missing /blog.

box_dir_create() function from boxr package is not creating a folder in Box

I've been having difficulty getting boxr to successfully create a file within my box directory. My code reads:
library(boxr)
box_auth()
my_file_dir <- box_setwd("76009318507")
box_dir_create(dir_name="TEST", parent_dir_id = my_file_dir)
after running which, I get the following output:
box.com remote folder reference
name :
dir id :
size :
modified at :
created at :
uploaded by :
owned by :
shared link : None
parent folder name :
parent folder id :
Checking my box directory, I find no folders have been created.
I've tried using additional arguments within box_dir_create, but according to the documentation only dir_name and parent_dir_name are accepted.
Any help is much appreciated. I understand this is a somewhat obscure R package, so I've included links to the documentation below:
https://cran.r-project.org/web/packages/boxr/boxr.pdf
https://github.com/r-box/boxr
I got an answer via the package's developer, and I figured I'd pay it forward for any fellow travelers in the future.
It turns out that box_setwd() sets a default directory but returns nothing. Using
box_dir_create(dir_name="TEST", parent_dir_id = "76009318507")
creates the folder successfully. It will not do so if a folder of the same name is already created.
After more digging, I was also told that box_dir_create() is quietly passing back a lot of useful information, including the newly created directory's ID. To access it you can save the function results as a variable, like so:
b <- box_dir_create("test_dir")
names(b) # lots of info
b$id # what you want
box_ul(b$id, "image_file.jpg") # is this file by file?
box_push(b$id, "image_directory/") # or a directory wide operation?
Thanks for your help, and I hope this helps someone else down the road. Cheers!

Documenter.jl: #autodocs for specific source files

From Documenter.jl's documentation of #autodocs:
[...], a Pages vector may be included in #autodocs to filter
docstrings based on the source file in which they are defined:
```#autodocs
Modules = [Foo]
Pages = ["a.jl", "b.jl"]
```
However, it also says
Note that page matching is done using the end of the provided strings
and so a.jl will be matched by any source file that ends in a.jl, i.e.
src/a.jl or src/foo/a.jl.
How can I restrict the #autodocs block to specific source files?
My package's source code is organized as
src/
foo/a.jl
foo/b.jl
ignore/a.jl
ignore/b.jl
other.jl
How to make the #autodocs block only consider files src/foo/a.jl and src/foo/b.jl but not src/ignore/a.jl and src/ignore/b.jl?
Unfortunately, Pages = ["foo/a.jl", "foo/b.jl"] didn't do it for me.
Thanks in advance.
x-ref: https://discourse.julialang.org/t/documenter-jl-autodocs-for-specific-source-files/8784
x-ref: https://github.com/JuliaDocs/Documenter.jl/issues/630
Turns out that this is a Windows issue due to absence of normalization of path separators (see linked github issue).
On Linux Pages = ["foo/a.jl", "foo/b.jl"] should work.
On Windows Pages = ["foo\\a.jl", "foo\\b.jl"] should work.
EDIT: joinpath.("foo", ["a.jl", "b.jl"]) should work on any OS.

QFileSystemModel remove folder from Watcher

I have a QFilesystemModel used in a QTreeView. Every time I remove a folder (e.g. through shutils.rmtree()) which is watched by the underlying QFilesystemWatcher I get a this warning
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: Datei oder Verzeichnis nicht gefunden
QFileSystemWatcher: failed to add paths: /path/to/deleted/folder
In my mind this should be solved by removing the folder from QFileSystemWatcher before removing it with QFileSystemWatcher.removePath(). But this doesn't work as there seem to be no way to get in touch with the QFileSystemWatcher from a QFileSystemModel (I searched for a solution without luck).
So is there any other way I can tell the QFileSystemModel to stop watching the folder?
PS: I know I could use QFileSystemModel.remove() or .rmdir() which would handle this automaticaly. But that's not an option for me. I need to remove the folder from outside the QFileSystemModel.
I'm using Qt4 with Python3 on Linux.
Firstly, QFileSystemModel and QFileSystemWatcher are two different classes. They are not related in any way what-so-ever. QFileSystemModel does not do the watching, you should add the file watcher yourself.
By the way, do realize the QFileSystemModel::remove just deletes the file. You'll still get the error.
The QFileSystemWatcher is buried very deep beneath the code for QFileSystemModel which is why you cannot access it.
Edit:
However, there is a simple way as to how you can avoid the warning. Here is a code snippet. We are assuming that there is a folder called /tmp/trial with some files in it. This is the folder being viewed, and is deleted externally.
### == Code that creates a warning == ###
# Initial state
fsm = QFileSystemModel()
lv = QListView()
lv.setRootIndex( fsm.setRootPath( "/tmp/trial" ) )
# External deletion of "/tmp/trial", leads to this error
shutils.rmtree( "/tmp/trial" )
# Error
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: file or directory not found
QFileSystemWatcher: failed to add paths: /tmp/trial
### == Suggested edit == ###
# Initial state
fsm = QFileSystemModel()
lv = QListView()
lv.setRootIndex( fsm.setRootPath( "/tmp/trial" ) )
# Just before deleting
lv.setRootIndex( fsm.setRootPath( "/tmp" ) )
# External deletion of "/tmp/trial", gives no error
# This even look very neat for the user.
shutils.rmtree( "/tmp/trial" )
For the sake of simplicity, I have skipped the proxy model and used a list view, but the procedure be the same in your case with proxy model and tree view.

Resources